kdzwinel / SnappySnippet

Chrome extension that allows easy extraction of CSS and HTML from selected element.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add support for Firefox

captainbrosset opened this issue · comments

Awesome Web Extension Konrad!
I know Firefox has been adding more and more Web Extension APIs lately, so I thought I'd try it and see if it works.
The good news is, the extension can be installed, and the panel appears in DevTools.

Now, when you try to create a snippet, it stays frozen on the "Please wait. Creating a snapshot..." overlay, and there's an error in the console:

chrome.devtools.inspectedWindow.getResources is not a function InspectedContext.js:56

Indeed, I don't think this API has been implemented yet.

@rpl: do you know if this is planned? I think this will require some work on Firefox DevTools' back-end side, I think Chrome has a getResources RDP command that they can just use here behind the scenes, but we don't , so we'd have some wiring to do in order to get the resources using different DevTools actors I guess.

@captainbrosset yep, we plan to support inspectedWindow.getResources, it is filed as Bug 1361121 (the current plan is to implement a first version of it which is limited to the 'document' resources, which seems to be enough for the usage that a lot of addons are using it, and then extend the resource types supported as follow-ups of the above bugzilla issue).

I haven't tried this addon yet, but I briefly looked at the sources and I also saw that it uses the frameURL option on inspectedWindow.eval (this eval option is not currently supported, I'm going to file a bug for it on bugzilla asap).

Thanks @rpl, happy to see this move forward.
I love all the work your doing with these APIs, because it means we get so many cool extensions for free!

For free?? I will gladly help you, but I demand a compensation of one (1) Firefox sticker 😉

Update of this extension is long overdue, I have some nice looking PRs to merge and refactoring planned, but getResources is here to stay. Ping me when you'll be ready and I'll happily test it in FF and upload to addons.mozilla.org 🙌

BTW I have couple more front-end-dev related extensions:

related to #6