Page 1 of 1

Image Toolbox extension on UXP

Posted: 2018-08-05, 07:52
by daftman1
I've recently tried the 28.0.0b5 (64-bit, Linux) and found it works quite nicely - with the only exception being the "Image Toolbox" extension (1.0.2, PM version). The button exists but it saves not the image but a .htm file instead (tested on dilbert.com).
This extension works fine with PM 27.9.4 - does anyone know if it can/will be updated or if there is a working alternative on UXP?

Re: Image Toolbox extension on UXP

Posted: 2018-08-05, 08:22
by New Tobin Paradigm
I will look into it at some point. No promises.

Re: Image Toolbox extension on UXP

Posted: 2018-08-05, 16:59
by Sob__
It's only wrong filename, but content is ok. The image url is http://assets.amuniversal.com/be4233905 ... 5056a9545d, but name should come from header (Content-Disposition: inline; filename="dt180805.jpg"). Extension fails to get that header and complains about "nsISupportsCString" not defined. I can't say that I know exactly what I'm doing here, but this fixed it for me:

Code: Select all

diff -Naur original/overlay.js pm28fix/overlay.js
--- original/overlay.js	2017-02-16 01:16:00.000000000 +0100
+++ pm28fix/overlay.js	2018-08-05 18:45:50.000000000 +0200
@@ -548,6 +548,7 @@
     // otherwise do our own thing
     else 
     { 
+      const nsISupportsCString = Components.interfaces.nsISupportsCString; 
       const nsILocalFile = Components.interfaces.nsILocalFile;
       var contentDisposition = null;
       var contentType = null;

Re: Image Toolbox extension on UXP

Posted: 2018-08-05, 19:43
by daftman1
Indeed, I applied your fix and it looks like saving is working fine again - thanks for the quick help!

Re: Image Toolbox extension on UXP

Posted: 2018-08-06, 12:08
by New Tobin Paradigm
Please submit a proper pull request to https://github.com/binoc-central/imagetoolbox. I will accept it and release an update.