MozillaZine

Execute Script on Firefox Exit

Discussion of general topics about Mozilla Firefox
.tommygun.
 
Posts: 10
Joined: November 6th, 2017, 8:03 am

Post Posted November 6th, 2017, 3:45 pm

I have a very simple script that I would like to execute automatically when Firefox exits.
Is this somehow possible ?

morat
 
Posts: 2447
Joined: February 3rd, 2009, 6:29 pm

Post Posted November 6th, 2017, 6:12 pm

Do you want to use an XPCOM interface in a script?

XPCOM Interface Reference
http://developer.mozilla.org/en-US/docs ... /Interface

Someone in a german forum got the userChromeJS extension working in Firefox 57.

userChromeJS
http://userchromejs.mozdev.org/

More info: viewtopic.php?p=14747866#p14747866

It's easier to run a script at startup, then at shutdown.

.tommygun.
 
Posts: 10
Joined: November 6th, 2017, 8:03 am

Post Posted November 7th, 2017, 12:05 am

....... thanks for your reply.
I'm running the script at startup now and it's working fine.
The script just replaces the webappsstore.sqlite with a saved copy of mine.
It's because my Privacy & Security settings are for cookies:
Keep until I close Firefox and Clear history when Firefox closes with all settings checked.
With this the saved settings for an installed add-on reverted back to default on the next start of Firefox.
Still I would like to execute this script when Firefox exits, because now if links in e-mails for example are clicked, Firefox starts normal without using my script.
Hopefully I will find a solution to this sooner or later, as this is a privacy issue that bugs me.
My knowledge and time is too limited to get this done with XPCOM or userChromeJS, but I'll check it out again when I find the time.
Thanks again for your help .......

morat
 
Posts: 2447
Joined: February 3rd, 2009, 6:29 pm

Post Posted November 7th, 2017, 10:11 am

tommygun wrote:I'll check it out again when I find the time.

I heard the topic is difficult.

Lithopsian wrote:Accessing local storage from an addon is a nightmare.

More info
http://discourse.mozilla.org/t/8000

Reference
http://dxr.mozilla.org/mozilla-release/ ... ncipal.idl
http://dxr.mozilla.org/mozilla-release/ ... anager.idl
http://dxr.mozilla.org/mozilla-release/ ... anager.idl

Return to Firefox General


Who is online

Users browsing this forum: Bing [Bot] and 4 guests