Changes between Initial Version and Version 3 of Ticket #7338


Ignore:
Timestamp:
03/19/2019 12:34:39 PM (17 months ago)
Author:
kzar
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #7338

    • Property Owner set to kzar
    • Property Keywords manifestv3 added
    • Property Summary changed from Don't use any DOM API's in the background page to Don't use any DOM APIs in the background page
  • Ticket #7338 – Description

    initial v3  
    33 
    44=== What to change === 
    5 Remove any usage of web APIs that don't exist in Service Workers from code that runs in the background page. This code can be identified by changing the ESLint environment from `browser` to `serviceworker` for the code in `lib/*`. 
     5Some APIs we use still exist for Service Workers, but not under the `window` Object. Alter references to those, to not include `window`. Specifically `window.Notification`, `window.clearInterval`, `window.navigator`, `window.setInterval` and `window.setTimeout`. 
     6 
     7Some APIs we use won't be accessible under Service Workers, remove/replace use of those. Specifically: `DOMParser`, `Image`, `XMLHttpRequest`, `document.addEventListener`, `document.createElement`, `document.documentElement.appendChild`, `document.documentElement.removeChild`, `document.querySelector`, `document.readyState`, `document.removeEventListener` and `window.confirm`. 
     8 
     9To confirm which APIs might not exist in Service Workers you can change the ESLint environment from `browser` to `serviceworker` for our scripts which run in the background page. But note, I found false positives were flagged, specifically: `URL`, `console.error`, `console.trace`, `fetch` and `indexedDB`.