Closed JadeMaveric closed 3 years ago
Hey @JadeMaveric, I can take care of this
Hey @mo-jinbuu, are you working on this?
@JadeMaveric - if you do not mind, I would like to give this a try! :)
Hey @mo-jinbuu, are you working on this?
Yeah I'm still working on this but I've been running into some issues.
Getting this error on chrome. Seems like promised-based approach is only valid in Firefox according to this stack overflow thread (https://stackoverflow.com/questions/45957590/chrome-tabs-queryobject-doesnt-match-definition). We can either turn chrome.tabs.query into a callback function or include Mozilla's Polyfill API that should take care of converting that method.
Tried including the polyfill api but having some issues with that. Going to try to make that tabs.query method into a callback and see if that fixes the issue.
@mo-jinbuu Yup, the callback paradigm definitely seems easier at this point. At some point I'll consider using the Polyfill to make a one size fits all addon. But for now the callback will do. For consistency, put all the chrome related code in it's own folder
@er-raoniz Sorry, @mo-jinbuu already started working on this. There's plenty other issues to try out :smile_cat:
Opened a PR for this #7. Took me awhile but it works for me on Chrome and Firefox. There is one issue though which I need some input on:
Chrome doesn't allow inline scripts (source: https://developer.chrome.com/extensions/contentSecurityPolicy#relaxing-inline-script). The issue is that I don't see where these functions are coming from (handleApply() and handleToggle). May be they're legacy code and aren't being used. Not sure exactly.
@mo-jinbuu I checked out the PR, good job! You're right, the handleToggle and handleApply are legacy and have been replaced with the document event handler. You can remove the onclick attribute, and everything should be fine.
Add that to the PR and I'll accept it.
@JadeMaveric - If it's still open and unfixed, can I close this quickly with a PR?
@er-raoniz The PR was updated and accepted yesterday. I should mark this as closed to avoid any confusion
I use firefox like 90% of the time. Since this started out as a personal project. It made a lot of sense to develop it for firefox.
The Firefox extension API uses the standard
broswer.*
namespace with Promises. This is what most browsers should be using, and it's what Edge has also adopted.However, Chrome uses it's own
chrome.*
namespace, and the older callback mechanism. Functionality between the two are similar. And firefox does offer compatiblity for thechrome.*
namespace. Porting this extension to chrome should be easy.I'm leaving this one open for Hacktoberfest