5digits / dactyl

Pentadactyl and other related Gecko extensions
Other
470 stars 98 forks source link

Pentadactyl and Firefox extension signing #5

Closed mario-grgic closed 9 years ago

mario-grgic commented 9 years ago

Firefox will start mandating extensions signing most likely after Firefox 39:

https://blog.mozilla.org/addons/2015/02/10/extension-signing-safer-experience/

This means users of extensions will not be able to modify the extension's XPI and this poses a bit of a problem, since currently I have to modify dactyl.css and customize it differently on Mac OS X and Windows 7 each time I update pentadactyl. This is not too big of an issue currently, I have dactyl.css.patch file, I open the pentadactyl.xpi in Vim and diffpatch the dactyl.css directly in the XPI and everything is fine.

However, this will no longer be possible after signing is mandatory. Even worse downloading the dactyl source code and modifying it will not be possible either (basically you will have to fork the extension change the extension ID and re-submit it for signing if you want to build it yourself). This is even less practical.

This is why it would be good if pentadactyl code could detect which firefox and OS it is running on and change the relevant dactyl.css values or perhaps use difference OS/Firefox version specific dactyl.css.

This is necessary since on Mac OS X and Windows 7 (I don't know about other OSes) tabs are rendered protruding past the tabbar. So for example on Mac OS X I have to apply the following patch to make it look decent again:

--- dactyl.css  2015-02-23 09:22:51.000000000 -0500
+++ dactyl.css.new  2015-02-23 09:22:37.000000000 -0500
@@ -230,20 +230,20 @@
 /* Fix ginormous Australis tabs. */
 [dactyl-australis=true] :-moz-any(xul|tab.tabbrowser-tab, .tabs-newtab-button)
         .tab-background > * {
-    min-height: 24px !important;
-    max-height: 24px !important;
+    min-height: 30px !important;
+    max-height: 30px !important;
 }

 [dactyl-australis=true] :-moz-any(xul|tab.tabbrowser-tab, .tabs-newtab-button)
     .tab-background > :-moz-any(.tab-background-start, .tab-background-end)::after {
-    background-size: 30px 24px !important;
-    max-height: 24px !important;
-    min-height: 24px !important;
+    background-size: 30px 30px !important;
+    max-height: 30px !important;
+    min-height: 30px !important;
 }

 [dactyl-australis=true] .tabbrowser-tabs {
-    min-height: 0 !important;
-    max-height: 24px !important;
+    min-height: 33px !important;
+    max-height: 33px !important;
 }

 /* Fix stupid line... */

Slightly different values are needed on Windows 7.

kmaglione commented 9 years ago

I'm not sure what extension signing has to do with this. You can change styles with the :style command without modifying the XPI, and there will be unbranded builds that will allow unsigned add-ons, in any event.

mario-grgic commented 9 years ago

Ok, I had no idea style command existed. But even after reading the help, it's not obvious to me how to use the style command to achieve the same effect as the above dactyl.css customization?

kmaglione commented 9 years ago
:style chrome://browser/* <<EOF
    [dactyl-australis=true] :-moz-any(xul|tab.tabbrowser-tab, .tabs-newtab-button) .tab-background > * {
       min-height: 30px !important;
       max-height: 30px !important;
    }

    [dactyl-australis=true] :-moz-any(xul|tab.tabbrowser-tab, .tabs-newtab-button)
        .tab-background > :-moz-any(.tab-background-start, .tab-background-end)::after {
       background-size: 30px 30px !important;
       max-height: 30px !important;
       min-height: 30px !important;
    }

    [dactyl-australis=true] .tabbrowser-tabs {
       min-height: 33px !important;
       max-height: 33px !important;
    }
EOF
mario-grgic commented 9 years ago

Wow, thank you. And all this time I have been manually patching the dactyl.css :D.

ghost commented 9 years ago

This should probably be closed, then.