- 
                Notifications
    You must be signed in to change notification settings 
- Fork 334
Closed
Labels
maintenanceChores and refactoringChores and refactoring
Description
related: #315
This will do a better job at preventing a userscript from calling api methods that were not in the @grant values and prevent userscripts from directly sending browser.sendMessage or calling browser methods like browser.storage.
In order to accomplish this userscript code needs to be isolated from the GM api code ("pre" code).
example:
const browser = window.browser;
delete window.browser;
(function() {
  "use strict"
  // userscript "pre" code
  (function() {
    const browser = undefined;
    // userscript code
  })();
})(); Metadata
Metadata
Assignees
Labels
maintenanceChores and refactoringChores and refactoring
Projects
Status
Release