Image Toolbox extension on UXP

This board is for discussions, bug reports, etc. for pre-releases of the v28 milestone building on UXP.

Moderator: satrow

daftman1
Moongazer
Moongazer
Posts: 7
Joined: 2016-08-20, 19:57

Image Toolbox extension on UXP

Unread post by daftman1 » 2018-08-05, 07:52

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?

User avatar
New Tobin Paradigm
Off-Topic Sheriff
Off-Topic Sheriff
Posts: 5883
Joined: 2012-10-09, 19:37
Location: Sector 001

Re: Image Toolbox extension on UXP

Unread post by New Tobin Paradigm » 2018-08-05, 08:22

I will look into it at some point. No promises.

User avatar
Sob__
Fanatic
Fanatic
Posts: 199
Joined: 2014-02-17, 01:12
Location: CZ

Re: Image Toolbox extension on UXP

Unread post by Sob__ » 2018-08-05, 16:59

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;

daftman1
Moongazer
Moongazer
Posts: 7
Joined: 2016-08-20, 19:57

Re: Image Toolbox extension on UXP

Unread post by daftman1 » 2018-08-05, 19:43

Indeed, I applied your fix and it looks like saving is working fine again - thanks for the quick help!

User avatar
New Tobin Paradigm
Off-Topic Sheriff
Off-Topic Sheriff
Posts: 5883
Joined: 2012-10-09, 19:37
Location: Sector 001

Re: Image Toolbox extension on UXP

Unread post by New Tobin Paradigm » 2018-08-06, 12:08

Please submit a proper pull request to https://github.com/binoc-central/imagetoolbox. I will accept it and release an update.

Locked