getstation / electron-chrome-extension

Implementation of Chrome extension APIs for Electron
139 stars 26 forks source link

Streak #15

Open alexstrat opened 6 years ago

alexstrat commented 6 years ago

Extension id: pnnfemgpilpdaojpnkjdgfgbnnjojfik Chrome Webstore

alexstrat commented 6 years ago

With Electron 1.7.8 ❌

Error in Inbox's webview:

Uncaught TypeError: Cannot read property 'appendChild' of null (document.head)
    at addScriptToPage (VM151 concatenated_js.js:1032)
    at loadScript (VM151 concatenated_js.js:1109)
    at Object.<anonymous> (VM151 concatenated_js.js:1530)
    at Object._loadScript (VM151 concatenated_js.js:501)
    at Object.preload (VM151 concatenated_js.js:1538)
    at Object.chrome.63.../common/load-script (VM151 concatenated_js.js:1477)
    at s (VM151 concatenated_js.js:22)
    at VM151 concatenated_js.js:22
    at Object.chrome.65../inboxsdk (VM151 concatenated_js.js:1559)
    at s (VM151 concatenated_js.js:22)
    at e (VM151 concatenated_js.js:22)
    at VM151 concatenated_js.js:22
    at runContentScript (/Users/alexandrelacheze/Dev/Station/electron-chrome-extension/lib/renderer/content-scripts-injector…:28)
    at Object.onceWrapper (events.js:293)
    at emitNone (events.js:86)
    at process.emit (events.js:188)
alexstrat commented 6 years ago

With electron electron/electron#11131 and #6 ❌

No more TypeError: Cannot read property 'appendChild' of null

2 minor fixes necessary

Missing API chrome.extensions.getAll

Hidden behind this error in background page:

Error in portResponder: Error: Failed to find path
    at callBackgroundFunction (VM176 background.js:383)
    at VM176 background.js:293
    at new Promise (<anonymous>)
    at Object.handler (VM176 background.js:291)
    at VM176 background.js:415
    at <anonymous>

Problems with CORS (?)

In the injection host:

Failed to load https://mailfoogae.appspot.com/api/v1/getscript?url=https%3A%2F%2Fwww.google.com%2Fjsapi: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'chrome-extension://pnnfemgpilpdaojpnkjdgfgbnnjojfik' is therefore not allowed access.

got error 
 message:Request finished with status 0
 stack: Error: Request finished with status 0
    at e (https://mailfoogae.appspot.com/build/app.js:1:9032)
    at e.t (https://mailfoogae.appspot.com/build/app.js:1:8668)
    at e (https://mailfoogae.appspot.com/build/app.js:1:7044)
    at e (https://mailfoogae.appspot.com/build/app.js:1:5613)
    at XMLHttpRequest.e._rollbar_wrapped.e._rollbar_wrapped (https://mailfoogae.appspot.com/build/app.js:876:4379)
 extra details: {"url":"https://mailfoogae.appspot.com/api/v1/getscript?url=https%3A%2F%2Fwww.google.com%2Fjsapi"}

Does setIsolatedWorldContentSecurityPolicy really work?