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

Update Firefox extension to WebExtension. #47

Open
Spazturtle opened this issue Aug 10, 2017 · 8 comments
Open

Update Firefox extension to WebExtension. #47

Spazturtle opened this issue Aug 10, 2017 · 8 comments

Comments

@Spazturtle
Copy link

Tomorrow legacy extensions are going to be disabled by default in Firefox Nightly 57 and in a month in Beta and in a month after that in Stable.

https://mail.mozilla.org/pipermail/dev-addons/2017-August/003059.html

@MairusuPawa
Copy link

Any news on this?

@Shugabuga
Copy link
Contributor

So far no. I might have to suck it up and port it in a couple days before users start noticing that BPM is broken.

I probably will do a shit job, but 🤷‍♂️.

@Shugabuga
Copy link
Contributor

Shugabuga commented Sep 19, 2017

Update: TypeError: chrome.extension.sendMessage is not a function

This is going to be harder than it should be. However, I have a hutch changing the namespace might do.

On the bright side, I think I fixed the options page.

@Rothera
Copy link
Owner

Rothera commented Sep 19, 2017

I think I'm going to owe you something nice if you pull this off.

@Shugabuga
Copy link
Contributor

Shugabuga commented Sep 19, 2017

I think I pulled it off, and it was due to chrome.extension becoming chrome.runtime.

Just changing a few lines made it port nearly flawlessly (see below for why), on top of changing the manifest (which could be easily dictated in the Makefile.

For instance, this line (cr-background.js)...

chrome.browser.onMessage.addListener(function(message, sender, sendResponse) {

...had to be changed to...
This line (cr-background.js)...

chrome.runtime.onMessage.addListener(function(message, sender, sendResponse) {

Everything in the below tests work in both Chrome Canary and Firefox Nightly:

Tested:

  • Emote browser
    • Emote Insertion
    • Help Menus
    • Resizing/Moving
    • Escape-To-Close
    • Prevent Dragging Off Screen
  • Animotes
  • Collapse Emotes
  • Effects
  • ExtraCSS effects
  • Preferences
  • RES Support
    • Live Preview
    • Night Mode
    • Show In Front-Page Preview
  • Everything From This Thread works
  • [](/spoiler)
  • Text Effects ([Hello](/red!-center) works as intended)

@Andoryuu
Copy link

Our saviour Shugabuga.
I didn't try to actually recompile it from the source with the commit. Just downloaded the old chrome version, converted to xpi and mass replaced the runtime. But it still works and I can see ponies once again.

Thank you.

@Shugabuga
Copy link
Contributor

Glad I was able to help out!

Also, if anyone needs to use this build immediately (i.e. the latest version of BPM no longer runs in Firefox), I have compiled and listed it here.

@bb010g
Copy link

bb010g commented Sep 29, 2017

I wrote an alternative patch over at #49, which I think would be nicer long-term.

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

Successfully merging a pull request may close this issue.

6 participants