Set world
property directly in manifest.json
to skip extra permission
#1013
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Details
This PR disables loading Content Scripts, where
world: 'MAIN'
is set, using background script. The previous approach causes extra permission in to be added, which negatively impacts Chrome Store reviews and provides arguably a more scary warning popup (permission popup on install) to end users than what is necessary.However, it keeps the existing behaviour for development to take advantage of automatically triggered browser refreshes.
This PR passes on the world property directly to the manifest. It is officially supported by the chrome. https://developer.chrome.com/docs/extensions/reference/api/scripting#type-ExecutionWorld
It is however not supported by Firefox but that doesn't alter the current behaviour (it is not supported at all).
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/scripting/ExecutionWorld#browser_compatibility
This is also the answer to my question here #433 (comment).
Legacy discussion for the initial implementation: #422
Code of Conduct
Contacts
If your PR is accepted, we will award you with the
Contributor
role on Discord server.To join the server, visit: https://www.plasmo.com/s/d