Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to extension: CrazyGamesAdApi #1324

Closed
3 tasks done
ZachjuKamashi opened this issue Jun 27, 2024 · 7 comments
Closed
3 tasks done

Update to extension: CrazyGamesAdApi #1324

ZachjuKamashi opened this issue Jun 27, 2024 · 7 comments
Assignees
Labels
✨ New extension A new extension

Comments

@ZachjuKamashi
Copy link

Description

Update to CrazyGamesAdApi extension, from 1.2.2 to 1.3.0.

  • Added GameLoading start/stop api call
  • SDK does not auto load now and has to be called in a project with "LoadSDK". (This was done because you only need the API on CrazyGames and don't need to load it if it isn't on CrazyGames)

This update to the extension was made with some assistance from @lhphr.

How to use the extension

Due to SDK not auto loading anymore, this breaks current projects as they need to add LoadSDK action to the start of their game.
With newly added GameLoading start/stop api calls, you can now tell CrazyGames whether your game is loading or not

Checklist

  • I've followed all of the best practices.
  • I confirm that this extension can be integrated to this GitHub repository, distributed and MIT licensed.
  • I am aware that the extension may be updated by anyone, and do not need my explicit consent to do so.

What tier of review do you aim for your extension?

Reviewed

Example file

Since this can only be tested on CrazyGames, there is no reason to have an example file, though I can confirm that it works as expected as we are using this in "Golf Adventures! 2"

Extension file

CrazyGamesAdApi.json

@ZachjuKamashi
Copy link
Author

CrazyGamesAdApi.json
Tweaked the extension so that now SDK only loads if it's on CrazyGames thus making this a non breaking change now

@Bouh
Copy link
Contributor

Bouh commented Jun 28, 2024

The update has been merged in #1325
Thank you for the new actions.

@Bouh Bouh closed this as completed Jun 28, 2024
@ZachjuKamashi
Copy link
Author

The update has been merged in #1325 Thank you for the new actions.

@Bouh Did you take a look at the update we posted where the SDK only loads if it's on CrazyGames?

@Bouh
Copy link
Contributor

Bouh commented Jul 9, 2024

The update has been merged in #1325 Thank you for the new actions.

@Bouh Did you take a look at the update we posted where the SDK only loads if it's on CrazyGames?

I'm not convinced by the way the url is filtered, the referrer checks the url where the user come from.
This would mean that if a user opens google.com, then opens a CrazyGames game with this extension from his favorites, then the url that will be checked is the one from Google. So the SDK won't load.
I'd rather let the SDK load manually than automate things that in some cases wouldn't work.

@lhphr
Copy link

lhphr commented Jul 9, 2024

Each game within CrazyGames is embedded inside an iframe. Following the documentation listed here:

  • Inside an <iframe>, the Document.referrer will initially be set to the href of the parent's Window.location in same-origin requests. In cross-origin requests, it's the origin of the parent's Window.location by default.

The parent hostnames (hostname is a smaller segment of origin) that I've so far gathered from the games hosted on CrazyGames is "games.crazygames.com" on the main page and "graph.crazygames.com" on the submission and review process, but I decided to check if the hostname ends with ".crazygames.com" just to be a bit more on the safe side.

Going to a CrazyGames game from the favorites/bookmarks wouldn't impact anything as it doesn't affect iframe elements.

@Bouh
Copy link
Contributor

Bouh commented Jul 10, 2024

Each game within CrazyGames is embedded inside an iframe. Following the documentation listed here:

  • Inside an <iframe>, the Document.referrer will initially be set to the href of the parent's Window.location in same-origin requests. In cross-origin requests, it's the origin of the parent's Window.location by default.

The parent hostnames (hostname is a smaller segment of origin) that I've so far gathered from the games hosted on CrazyGames is "games.crazygames.com" on the main page and "graph.crazygames.com" on the submission and review process, but I decided to check if the hostname ends with ".crazygames.com" just to be a bit more on the safe side.

Going to a CrazyGames game from the favorites/bookmarks wouldn't impact anything as it doesn't affect iframe elements.

ok, let me give a last check, before a merge of this auto load today.

@Bouh
Copy link
Contributor

Bouh commented Jul 10, 2024

I merged the auto load in this PR #1333

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ New extension A new extension
Projects
None yet
Development

No branches or pull requests

3 participants