sawyerpollard / MineWeather

Chrome Extension that displays a Minecraft scene on New Tabs depending on local weather conditions.
https://chrome.google.com/webstore/detail/mineweather/gklgaaagldobfcacmhhbnbgofohfgneb
67 stars 11 forks source link

Firefox support #2

Closed Lunarequest closed 3 years ago

Lunarequest commented 3 years ago

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

TheBooker66 commented 3 years ago

This is an explanation of how to do it, curtesy of /u/RasterCrow in this comment

khalby786 commented 3 years ago

I did it!

Few things to keep in mind if you're doing this:

I can release this as a Firefox extension if @sawyerpollard permits!

Lunarequest commented 3 years ago
  ```
   - 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

khalby786 commented 3 years ago
  • 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!

TheBooker66 commented 3 years ago

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.

khalby786 commented 3 years ago

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.

sawyerpollard commented 3 years ago

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/

sawyerpollard commented 3 years ago

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.

TheBooker66 commented 3 years ago

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.

sawyerpollard commented 3 years ago

The extension is now on Firefox! https://addons.mozilla.org/en-US/firefox/addon/minecraft-weather-new-tab/