Thunderbird v60 caching old extension code

Talk about add-ons and extension development.
Post Reply
bralphs
Posts: 6
Joined: February 17th, 2015, 1:54 pm

Thunderbird v60 caching old extension code

Post by bralphs »

Did something change in the way Thunderbird v60 loads extensions. I used to be able to change my source code, restart TB & the new code would take effect. New it seams to be saving/caching the old code & I have to uninstall the extension & reinstall it every time I make a minor change to the code.
morat
Posts: 6403
Joined: February 3rd, 2009, 6:29 pm

Re: Thunderbird v60 caching old extension code

Post by morat »

Try using the -purgecaches command line option.

i.e.

thunderbird.exe -purgecaches
ThunderbirdPortable.exe -purgecaches

More info
http://developer.mozilla.org/docs/Exten ... _4#Caching

I think if the test extension is in the extensions folder in the profile folder, then you don't need to purge the caches - the application does it automatically when the code changes.

P.S.

I'm using a restart button to purge the caches.

* left click - restart
* shift left click - restart and invalidate caches on restart

Code: Select all

if (event.button == 0) {
  if (event.shiftKey) {
    Services.appinfo.invalidateCachesOnRestart();
    Services.prompt.alert(window, "Example", "Invalidate caches on restart.");
  }
  var os = Components.classes["@mozilla.org/observer-service;1"].
    getService(Components.interfaces.nsIObserverService);
  var cancelQuit = Components.classes["@mozilla.org/supports-PRBool;1"].
    createInstance(Components.interfaces.nsISupportsPRBool);
  os.notifyObservers(cancelQuit, "quit-application-requested", "restart");
  if (cancelQuit.data) {
    Services.prompt.alert(window, "Example", "Abort restart process.");
  } else {
    var appStartup = Components.classes["@mozilla.org/toolkit/app-startup;1"].
      getService(Components.interfaces.nsIAppStartup);
    appStartup.quit(appStartup.eAttemptQuit | appStartup.eRestart);
  }
}
bralphs
Posts: 6
Joined: February 17th, 2015, 1:54 pm

Re: Thunderbird v60 caching old extension code

Post by bralphs »

Great thx very much
DN123ABC
Posts: 695
Joined: January 9th, 2017, 10:10 am

Re: Thunderbird v60 caching old extension code

Post by DN123ABC »

Not sure, but the Google Provider extension no longer works for me. I think it also involves McAfee antivirus, but it worked OK in the older versions before 60. I have a post about that here: http://forums.mozillazine.org/viewtopic ... &t=3043626
Ed1
Posts: 1059
Joined: January 30th, 2005, 2:33 pm

Re: Thunderbird v60 caching old extension code

Post by Ed1 »

morat, you mention a couple of posts prior that you are using a Restart button to clear cache in Thunderbird.

I believe the Restart button was removed from recent versions of both Thunderbird and Firefox.

Have you been able to add back a Restart button to Thunderbird? To Firefox? If so, how did you do it.

Thanks.
morat
Posts: 6403
Joined: February 3rd, 2009, 6:29 pm

Re: Thunderbird v60 caching old extension code

Post by morat »

Here is how to create a restart button in the Addons Manager in Thunderbird.

Code: Select all

/* Thunderbird userContent.css */

@-moz-document url-prefix("about:addons"),
url-prefix("chrome://mozapps/content/extensions/extensions.xul") {
  #updates-restart-btn {
    display: -moz-box !important;
  }
  #updates-restart-btn .button-icon {
    list-style-image: url("restart.png") !important;
  }
  #updates-restart-btn .button-text {
    display: none !important;
  }
}
You would need to download a restart.png image to the chrome folder for the style to work correctly.

Example image:

Code: Select all

data:image/png;base64,
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAANbY1E9YMgAAAB
h0RVh0U29mdHdhcmUAUGFpbnQuTkVUIHYzLjM2qefiJQAAA2hJREFUOE9tkm1MU1ccxg9F
YKIIxbdgw4e9GEQYoomArRVYwsIoEakUsRQ3KQpiF8SXMDdtajL8gho+TKeJyYxaFGyltg
ZK1bkurg4uQ0QMgjSbOrbwUoIglPbe9tm5NdGgO8mT3PM/9/md/8sJIv+3JOYwGk6miolY
HB4y5ZqeIcDfxD87SH4vmg5YJOZk4veOvm+XmOOE+XfOZp7qfya/+Ny7/dq/KNAPTafoHv
VH5LZdJWmNnxKxKSE8xzYQuvHCl3MBEnNSwv7OkVKrC0rrBDabXiLX7EbhbQ6VncCBLi9S
dT2TCdXM5PbGIURlndv7FiAxR0fm3W4qu+VC0c1RyJpGkWucQLZxGjKLF1tsfqjuAYcesj
ja60F568hcQFhWqyL95JNXiisvkHGyF+LaHmSfcXKlLS5UOGZRbGex7RcOOxwc1AyLCus7
gCWKuz/FVTH+5UrjhFDeMB68qamPrD2tjSk0n19/5IHr4B9uVHR6UeLwYGeHB5Vtw3MzEE
hNTuGWyz+LSs7r53924Rz5sCyF1hcVKtWvj69qZ3R9s9AOsPj2iRdHn7LQ2N4BhGU21IiK
6nct2/pDSfCaY2JqXkAVLJBa7CuK7b41BxgkH2Sw9hCDdVQrd//GhaTUVxBaez7dsHyQP+
R/4iVS2X1BEuN9CllEtVQQ93XaUlmtIkZ+XBkiPn2YxlbwcbJkm12hsY1AO+jDdwMcjjk5
fN/vQbzmXve8xJovApmk6mM/yDJoY3deqovKbzQESU2DfHl8hgHA3rYRqLt8+IrhoOnmUN
PtBm3cmEjZdoaIm8sFm0y/CuVXB5crm5+vqmJ80Xk3DNQcTRUUAFRSQHk3oO6ks3ZQkIM2
qd2NMusYZD862Y3HH/kyTz32FdIRp5/omwlNqddQc/gbAD9TXZ8Hh3tZlHb46bxZyK0z2G
yZhNwyjvzmYRS3DENtG8OiHFMLiZGtpmZB4BXyGRQ3DSGxumMqTfdw6pseD/bRMlR33Sho
nULBzXHsuDUONc1m9b52F1lZzfeFb+zrRaewNTy75U/yieZzEn9EGpFjuZ6q7XIW6l/MqA
z/oODiX96MusdDUTnGBvJxZSa1RL65PUDYYBCRxNoM+iWkmkc+Ko8mSSckJLletSD97B6S
VLebgvNIZGIsPV8410zIfzl/yL/mmVpFAAAAAElFTkSuQmCC
Here is how to create a restart button in Firefox.

Firefox Quantum compatible userChrome.js
http://github.com/Sporif/firefox-quantum-userchromejs

Restart button
http://gist.github.com/Sporif/ad6e917d8 ... 80d3c8918c
Post Reply