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

No-op mode doesn't work on Safari #364

Closed
Helloyunho opened this issue Mar 2, 2022 · 3 comments
Closed

No-op mode doesn't work on Safari #364

Helloyunho opened this issue Mar 2, 2022 · 3 comments

Comments

@Helloyunho
Copy link

In Safari, no-op mode doesn't work as the line below returns true.

if (typeof globalThis.browser === "undefined" || Object.getPrototypeOf(globalThis.browser) !== Object.prototype) {

Strangely, the browser object on Safari inherits CallbackObject. So Object.getPrototypeOf(globalThis.browser) doesn't return Object.

Object.getPrototypeOf(Object.getPrototypeOf(globalThis.browser)) !== Object.prototype finally gives the expected value.

CleanShot 2022-03-02 at 23 14 30

@Helloyunho
Copy link
Author

It's almost the end of the year and I still couldn't find a solution for this 😢

xeenon added a commit to xeenon/webextension-polyfill that referenced this issue Mar 7, 2024
xeenon added a commit to xeenon/webextension-polyfill that referenced this issue Mar 9, 2024
Verify the object that might be at `globalThis.browser` is not already
implementing the basic Web Extension APIs. This is symmetric with the
check to verify the poly fill is only included in extension contexts.
@xeenon
Copy link
Contributor

xeenon commented Apr 3, 2024

This can now be closed.

@Helloyunho
Copy link
Author

This can now be closed.

Yeah, seems like #582 fixes this issue
I can't test right now but I believe the PR so Imma close the issue

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

No branches or pull requests

2 participants