Fix no-op check to work with Safari and support of old browsers#582
Fix no-op check to work with Safari and support of old browsers#582Rob--W merged 1 commit intomozilla:masterfrom
Conversation
|
The reason for looking up the immediate prototype is to avoid activating the polyfill when there is an element on the page that has an ID. Here is the PR that added the logic for more context: #153 (originally checking What is the actual prototype chain in Safari? Is it expected to be somewhat stable? |
The problem is the prototype is not reachable, so it can't be compared with the result of I think a better approach would be to do a similar optional chain check looking for |
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. Don't use optional-chaining for these checks, since this needs to continuing working in older browsers.
|
Thanks for the patch @xeenon! We'll fix our CI and then publish a new version. |
|
We still need to publish an update FYI. |
…config (#584) * chore(circleci): updated browser-tools orb to 1.4.8 and cimg/node to 20.12 * chore(deps-dev): bump chromedriver from 112.0.0 to 123.0.3 * chore(deps-dev): bump geckodriver from 3.2.0 to 4.3.3 * test: Update unit test to match new expected behaviors with changes applied from PR #582 --------- Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
|
FYI just released 0.11.0 that includes this patch: https://github.com/mozilla/webextension-polyfill/releases/tag/0.11.0 |
The
browserobject is not a direct descendant ofObject.prototypein Safari. This check should useinstanceoffor a more compatible check.