Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

browser.devtools.* isn't polyfilled #56

Closed
marcysutton opened this issue Sep 13, 2017 · 1 comment · Fixed by #57
Closed

browser.devtools.* isn't polyfilled #56

marcysutton opened this issue Sep 13, 2017 · 1 comment · Fixed by #57

Comments

@marcysutton
Copy link

marcysutton commented Sep 13, 2017

First of all, thanks for writing and maintaining this polyfill!

However...I'm trying to port a Chrome extension to Firefox and having a difficult time, as it seems that not all API methods are polyfilled. One example is browser.devtools.panels.create, which uses a callback signature in Chrome but is promise-based in Firefox. I've got the compiled polyfill implemented and Chrome is throwing an error:

Uncaught TypeError: Cannot read property 'then' of undefined
    at Object.2../actions/inspect (devtools.js:39)
    at s (devtools.js:1)
    at e (devtools.js:1)
    at devtools.js:1

That line points to this code:

browser.devtools.panels.create(name, '', 'panel/index.html').then((extensionPanel)  => {
//....
})

Is there a list of all the polyfilled methods somewhere, and/or perhaps a status for when the missing methods will be implemented?

Edit: I see the metadata file does not include any devtools APIs. Bummer.

@marcysutton marcysutton changed the title browser.devtools.panels.create isn't polyfilled browser.devtools.* isn't polyfilled Sep 21, 2017
@rpl rpl self-assigned this Sep 22, 2017
@rpl
Copy link
Member

rpl commented Sep 22, 2017

@marcysutton I'm going to look into this.

Unfortunately the devtools API namespace is the first nested namespace to be included in the polyfill, I've been testing this locally and it is currently not enough to just add the missing metadata in the api-metadata.json file (some changes to the browser-polyfill.js file are going to be required to handle the nested namespace correctly).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants