-
-
Notifications
You must be signed in to change notification settings - Fork 53
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
bug: conflicts between navigation()
and Safari's navigation()
#289
Comments
will investigate, I don't have Safari lol, that's the only problem |
can you disable globals and test if it works? |
Is global: false in kaplay({}) |
Testing KAPLAY alpha 18.1 on iOS/iPadOS Safari I don't have this issue |
After further testing on alpha 19.1 there also seems to be no issues. What version of kaplay are you using? |
Im using whatever loads from https://unpkg.com/kaplay@3001.0.0-alpha.19.1/dist/kaplay.js -- 3001alpha19.1, I guess. And I am on Mac Safari, not iPad. |
never mind, this fixes the "read only property" error. But shouldn't this be documented somewhere ("known bug: you can't use global: true in Safari")? |
It was to confirm what is related to the error, will investigate more |
It still happens? |
hang on, will test |
yes and this is with bleeding edge from #301 |
I don't have a safari device (only iPhone, and there works) so it's kinda hard to test but the bug seems to be here: kaplay.ts 1326 if (gopt.global !== false) {
for (const key in k) {
(<any> window[<any> key]) = k[key as keyof KAPLAYCtx];
}
} |
Maybe window is readonly in Safari? or we are assigning a readonly prop that's present only on Safari? |
I figured out what is the problem: I found it by adding: if (gopt.global !== false) {
for (const key in k) {
+ console.log("adding key:", key);
(<any> window[<any> key]) = k[key as keyof KAPLAYCtx];
}
} and I got ![]() Stinks that the WebKit people couldn't get the error message to say which property was readonly, that would have made it so much more obvious from the beginning... |
we probably should change it |
navigation()
and Safari's navigation()
My suggestion would be "navigator" because that's what the component makes the object into, and the docs for it use that language too |
gosh, whoops, never mind, that one conflicts with an even importanter property!! |
Yes, navigator was my first choice, but I couldn't use it due to that reason. That's why I took navigation. |
Describe the bug
This bug does not occur in Chrome or Firefox, it only occurs in Safari. The game just fails to load.
Version
3001.0.0-alpha.19 loaded from unpkg.
To Reproduce
Call kaplay(). That's it!!
Expected behavior
The game works!
Screenshots
The text was updated successfully, but these errors were encountered: