Robbendebiene / Gesturefy

Navigate, operate, and browse faster with mouse gestures! A customizable Firefox mouse gesture add-on with a variety of different commands.
https://addons.mozilla.org/firefox/addon/gesturefy/
GNU General Public License v3.0
790 stars 74 forks source link

Ability to change titlepreface for to enhance userChrome.css theme capability #703

Closed Shina-SG closed 6 months ago

Shina-SG commented 7 months ago

Describe your matter in detail

Currently I'm using this extension https://github.com/Joolee/userchrome-toggle with hotkey for switching titlepreface back and forth to trigger my theme in userChrome.css. I don't think this extension accept message send from Gesturefy, but can user script from Gesturefy toggle simillar function from userchrome toggle since I don't know much about user script much. Thanks in advance.

Screenshots or further assistance

Your System

Robbendebiene commented 7 months ago

Hi, I took a quick look at the extension. You should be able to use something like this as a user script:


API.windows.getCurrent().then((windowId) => {
  API.windows.update(windowId.id, {
    titlePreface: REPLACE_WITH_TITLE_PREFIX
  });
});

(not tested)

Using one of the prefixes defined here: https://github.com/Joolee/userchrome-toggle/blob/62eb529ac0e625fe8dd33cf28be07a378dd33303/uct-background.js#L3-L28

Otherwise ask the author of the extension to accept messages from other add-ons 🙂

Shina-SG commented 7 months ago

Thanks much, but does seems like user script doesn't work for some reason.

I was testing with a simple changing the titlepreface to XXX to hide the titlebar from this Sidebery's userChrome.css https://github.com/mbnuqw/sidebery/wiki/Firefox-Styles-Snippets-(via-userChrome.css)#dynamic-native-tabs

I guess it would be better that I implement API for the extension to accept message from Gesturefy.

Robbendebiene commented 7 months ago

According to my testing at least the prefix is successfully added to the window, but I cannot say anything about the userChrome stuff.

I guess it would be better that I implement API for the extension to accept message from Gesturefy.

At least this would solve a limitation user scripts are still suffering from which is that they are blocked on certain pages like GitHub.