Open TaylanTatli opened 10 years ago
Since the Chrome and Firefox APIs vary a lot, it would likely require a lot of rewriting. I would like to bring Homely to Firefox, but I don't really have the time to work on this at the moment.
With the upcoming Mozilla WebExtension API coming soon that'll allow chrome extensions to work with firefox do you think you might have time to possibly look into doing this?
This is quite promising, though I can't find an equivalent to chrome_url_overrides
in order to set the custom new tab page. May just require some extra manifest stuff, or at least exposing a URL you can use as your home page. In any case, this looks a lot more doable now! 😃
Sounds great :D honestly been thinking about switching to firefox for a while now because chrome has been very buggy for me lately, but this is one addon/extension that is stopping me from actually doing so as every new tab page I've tried for firefox so far sucks.. So if you can find a way to do it, it would be great!
I did try setting things up with Chrome Store Foxified and a tab switch overrider on firefox and trying out chrome-extension://fplghnonomhbnlhdnmjpipoomkjdpeim/newtab.html for the time being but of course that method didn't work out sadly.
Looks like it's a bit broken as-is. Steps to get it installed (using Firefox 49 developer):
about:debugging#addons
, check Enable add-on debugging.chrome.extension.getURL("res/html/homely.html")
will give you the main page address.But the stripy background is there, so that's something... 🎉
Yep using chrome store foxified addon and going and installing the addon from the chrome store and mainly doing the same steps as above I was able to get the stripy background as well after it gave me the url of moz-extension://ef82e03d-cf7f-4663-94dd-a676b07fb7c8/res/html/homely.html
so at least we can get to that point, now guess next thing is figuring out how to get everything else to work xD
Something quirky with the JavaScript going on, but no errors in the console...
More is happening than can be seen, because body
is hidden until everything is ready. If you remove the display: none;
(line 5) from res/css/homely.css, we can see what's actually going on.
Interestingly, link blocks do appear to be working, just not much else.
Ah, roadblock detected -- chrome.permissions
isn't supported yet. Would mean having to declare all permissions upfront, which is not ideal given the scope, or drop things like notifications/baskets for now.
Also means diverging the code base to handle both types of permissions, which could get messy. 😒
ooh wonder whats going on with the javascript to cause the issue with it not loading everything fully even though it's happening in the background.. and aww darn that sucks :( I didn't know the chrome.permissions wasn't supported yet, hopefully they get around to getting those supported soon enough..
Once they get them supported you wouldn't have to diverge the code base any right? so once it's supported you could theoretically possibly make this addon work with Firefox a whole lot more?
Noticed things like import/export and trying to save various options doesn't work either, guessing this is part of the javascript being quirky?
Hopefully, assuming it works the same as in Chrome, the two should behave the same. I'll hold off officially porting it for now, but will keep an eye on what happens with the WebExtensions spec.
Hopefully they will work the same as in chrome then, and alright that sounds fine :D glad that you are at least going to keep an eye on the WebExtensions stuff and hopefully be able to make an addon for firefox once development for it all opens up a bit more.
Quick update: looks like optional permissions are scheduled for Firefox 54.
The Firefox nightlies have most of the features for required permissions (unsure about optional) -- I'll hopefully find some time to poke around with this soon.
Seeing as Chrome has been quite a pain lately, I've swapped back to Firefox for a bit.
54.0a2, no sign of chrome.permissions
APIs yet. But here is a working page, complete with block editing and saving. 🙂 Just lacks the optional parts (bookmarks, history, notifications etc.) -- they'll probably work if given as required permissions.
The only other missing API is chrome.fontSettings
, which is needed here:
diff --git a/Homely/res/js/homely.js b/Homely/res/js/homely.js
index e104a00..959aabf 100644
--- a/Homely/res/js/homely.js
+++ b/Homely/res/js/homely.js
@@ -2087,10 +2087,12 @@ $(document).ready(function() {
}
- // request list of fonts from FontSettings API
- chrome.fontSettings.getFontList(function fontsCallback(fonts) {
- for (var i in fonts) {
- $("#settings-style-font").append($("<option/>").text(fonts[i].displayName));
- }
- $("#settings-style-font").val(settings.style["font"]);
- });
$(".ext-name").text(manif.name);
$(".ext-ver").text(manif.version);
A rough permissions mock to get the settings dialog working:
diff --git a/Homely/res/js/homely.js b/Homely/res/js/homely.js
index e104a00..f0727f5 100644
--- a/Homely/res/js/homely.js
+++ b/Homely/res/js/homely.js
@@ -17,4 +17,18 @@ $(document).ready(function() {
}
var manif = chrome.runtime.getManifest();
+ // mock out permissions model
+ if (!chrome.permissions) {
+ chrome.permissions = {
+ contains: function(perms, cbk) {
+ cbk(false);
+ },
+ remove: function(perms, cbk) {
+ cbk(true);
+ },
+ request: function(perms, cbk) {
+ cbk(false);
+ }
+ };
+ }
// default settings
var settings = {
Lookin good so far :D
For those still lurking in here, the permissions API now exists, and the latest commits should now allow the extension to be installed in Firefox without any edits.
@Terrance great! Does it mean that you are planning to add it to the Firefox Add-ons site?
Yes please @Terrance can you get this up on the firefox add-ons site? so it's an easy click and install of the extension.
Is it possible to make a firefox version? I don't like chrome but i'm using because your extension is so good.