NiklasGollenstede / re-style

A user style manager for Firefox 57+ which can load local files and apply UI styles
https://addons.mozilla.org/addon/re-style/
Mozilla Public License 2.0
38 stars 4 forks source link

Restart prompt #3

Closed Madis0 closed 6 years ago

Madis0 commented 6 years ago

I was thinking, why not make the reStyle ask for a restart after a style installation, just like Firefox used to do?

Restart prompt

Since popups can be opened programmatically and you have NativeExt anyway to execute code in OS, I think it should be fairly easy to add that feature.

Edit: just noticed the notification, but that doesn't have an option to actually restart the browser, so the suggestion remains.

NiklasGollenstede commented 6 years ago

You can only call this function from inside the handler for a user action, such as:

  • Selecting a context menu item defined by the extension.
  • Clicking a button in a page bundled with the extension.

Neither would be the case if styles are updated (automatically or from disk).

What I plan to do is change the color of the badge on the icon to yellow or orange when the content of the userChrome.cssor userContent.css` is different that what reStyle read when it was started (which it has to assume was the content when Firefox started and hence what is currently being applied).

If it is possible to restart the browser, the popup should have a button offering to do so in that case. But I don't think it is. Killing Firefox and running it's start commend again is not a clean restart (which you get for example by pressing Shift+F2 and typing restart).

Madis0 commented 6 years ago

What I plan to do is change the color of the badge on the icon to yellow or orange when the content of the userChrome.css or userContent.css` is different

Great idea, I like it.

Killing Firefox and running it's start commend again is not a clean restart (which you get for example by pressing Shift + F2 and typing restart ).

But how clean does it have to be? As long as the tabs are saved across sessions (which the user can set in main settings), it should provide the same result.

NiklasGollenstede commented 6 years ago

I'm not quite sure about this, but I think a proper restart doesn't end the session, i.e. e.g. session cookies won't be deleted.

And I also have the feeling that there are a lot of other ways one could mess up the restart (take for instance the temporary KEY=value <command> env args we talked about). I wouldn't want to do it unless I can be reasonably sure not to miss anything, which I currently am not.