Closed Lunarequest closed 3 years ago
I did it!
Few things to keep in mind if you're doing this:
manifest_version
to 2 because Firefox doesn't support 3.background.service_workers
(in manifest.json
) to background.scripts
and set the value to ["background.js"]
action
(in manifest.json
) to browser_action
manifest.json
) host_permissions
and update the permissions
array with the link of the Weather API, like this:
"permissions": [
"https://api.openweathermap.org/",
"geolocation",
"storage",
"alarms"
],
chrome.storage
or chrome.alarm
(or anything that starts with chrome
), replace chrome
with browser
. For example,
- chrome.storage.local.set({ units });
+ browser.storage.local.set({ units });
I can release this as a Firefox extension if @sawyerpollard permits!
``` - chrome.storage.local.set({ units }); + browser.storage.local.set({ units }); ```
this isn't needed as firefox supports the chrome namespace. browser and chrome are fundamentally incompatible as chrome uses call backs but browser uses promises. source: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Chrome_incompatibilities#firefox_supports_both_the_chrome_and_browser_namespaces
- chrome.storage.local.set({ units });
- browser.storage.local.set({ units });
this isn't needed as firefox supports the chrome namespace. browser and chrome are fundamentally incompatible as chrome uses call backs but browser uses promises. source: developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Chrome_incompatibilities#firefox_supports_both_the_chrome_and_browser_namespaces
Alright, I made that change and looks like its working perfectly fine! Thanks!
this is great! you can just fork it, and message /u/Archarin on reddit to link your fork in his original comment. I might even try to make this extension work with Opera GX.
Edit: also, you should probably close this issue.
I'll update the README a bit to reflect the changes.
As for messaging OP, I've already done it, I'm just waiting for a response.
EDIT: I'll close the issue when I get the green light from OP, after I've posted the link to Firefox here.
Wow, thank you for all your excitement around a Firefox version! I'm happy to say that I had submitted a version to Firefox and am simply waiting for its approval.
This link will work once the extension is approved: https://addons.mozilla.org/en-US/firefox/addon/minecraft-weather-new-tab/
this is great! you can just fork it, and message /u/Archarin on reddit to link your fork in his original comment. I might even try to make this extension work with Opera GX.
Edit: also, you should probably close this issue.
That's a good idea about Opera GX. I haven't used it, but I wonder why it's not working. Feel free to open up an issue.
I use Opera GX all the time (great browser, imo). I think the problem might stem from how they handle the new tab pages. There are sooo many options for it that although it originates from Chromium, it doesn't resemble it one bit. Thing is, there's virtually no info about this predicament on the web because it rarely happens. I might even try asking on stackoverflow, to see if someone has met the same problem in the past.
The extension is now on Firefox! https://addons.mozilla.org/en-US/firefox/addon/minecraft-weather-new-tab/
porting to firefox shouldn't be to hard given that both chrome and firefox have very similar apis. I wouldn't mind porting if instructions to build are given