mcdamo / tab-image-saver

Firefox addon to save images from open tabs
https://addons.mozilla.org/firefox/addon/tab-image-saver/
Mozilla Public License 2.0
40 stars 13 forks source link

Version 4.5.0 not working #94

Closed nikkopt closed 6 months ago

nikkopt commented 6 months ago

Icon shows a red badge with a 0, it affects all websites. Already tried the 3 different download methods.

Edit: Console shows

Object { url: "https://pbs.twimg.com/media/GK5DOxPWMAAArRM?format=jpg&name=small" }
content.js:1:2532
Message received: 
Object { type: "TAB_OPTIONS", body: {…} }
content.js:1:2608
getImages 50x50 content.js:1:1328
valid image (446x482): 
<img src="https://pbs.twimg.com/me…RM?format=jpg&name=small" alt="https://pbs.twimg.com/me…RM?format=jpg&name=small">
content.js:1:867
Result 
Array [ {…} ]

Object { action: "active", activeTab: true, browserAction: "download", closeTab: true, conflictAction: "uniquify", downloadAsync: false, downloadMethod: "contentFetch", downloadNum: 6, downloadPath: "images/stuff", downloadPrivate: true, … }
content.js:1:2428
deleting message listener
mcdamo commented 6 months ago

There was a bug related to downloading from private windows only, was that your issue?

Any error will be in the Extension console: go to page about:debugging#/runtime/this-firefox and Inspect this addon.

nikkopt commented 6 months ago

It wasn't me but i do confirm that the problem goes away if i disable "Run in private windows". I wasn't running firefox in private mode so i thought that wouldn't be related (it wasn't a problem in the past, i always had that option turned on because now and then i do use it in private windows). The error i have when having that option turned on is:

Download failed Error: Illegal to set non-private cookieStoreId in a private window 
Object { url: "blob:moz-extension://1a2b1d4a-f150-4635-af0f-17456f5a994e/f157f316-cd1f-4bb3-b443-07e487", path: "images/stuff/pbs.twimg.com/img_001.jpg", conflictAction: "uniquify", incognito: true, referrer: "https://pbs.twimg.com/media/GK9vJUyWoAAMpK9?format=jpg&name=medium", abortSignal: AbortSignal, downloadMethod: "contentFetch", cookieStoreId: "firefox-default" }
mcdamo commented 6 months ago

Thanks for the info, that is fixed in v4.5.1.

nikkopt commented 6 months ago

Don't know if it's supposed to be like that but now it's failing if i use the download methods "Fetch" or "Content-Fetch"

Content-Fetch:

running 
Object { windowId: 1, tabId: 13, action: "active" }
background.js:2:133370
URL queued: https://pbs.twimg.com/media/GK8IU8bbIAAOo8R?format=jpg&name=medium background.js:2:119731
rule: ${name}.${ext}, filename: GK8IU8bbIAAOo8R., valid: false background.js:2:112585
rule: ${xName}.${xExt||xMimeExt}, filename: .jpg, valid: false background.js:2:112585
rule: ${host}/img_${index.padStart(3,0)}.${ext||xExt||xMimeExt||"jpg"}, filename: pbs.twimg.com/img_001.jpg, valid: true background.js:2:112585
createFilename ${host}/img_${index.padStart(3,0)}.${ext||xExt||xMimeExt||"jpg"} pbs.twimg.com/img_001.jpg background.js:2:112719
fetchDownload from Tab(13) 0.003s: images/stuff/pbs.twimg.com/img_001.jpg background.js:2:85904
saveDownload(12) from Tab(13): images/stuff/pbs.twimg.com/img_001.jpg background.js:2:87174
Download(12) interrupted: C:\Users\Miguel\Downloads\images\stuff\pbs.twimg.com\img_001.jpg background.js:2:83104
Window(1) has ended 43 background.js:2:110289
imagesFailed https://pbs.twimg.com/media/GK8IU8bbIAAOo8R?format=jpg&name=medium: images/stuff/pbs.twimg.com/img_001.jpg => undefined background.js:2:109497
0 Saved, 1 Failed

Fetch:

running 
Object { windowId: 1, tabId: 13, action: "active" }
background.js:2:133370
URL queued: https://pbs.twimg.com/media/GK8IU8bbIAAOo8R?format=jpg&name=medium background.js:2:119731
rule: ${name}.${ext}, filename: GK8IU8bbIAAOo8R., valid: false background.js:2:112585
XHRHEAD
https://pbs.twimg.com/media/GK8IU8bbIAAOo8R?format=jpg&name=medium
[HTTP/2 200  18ms]

rule: ${xName}.${xExt||xMimeExt}, filename: .jpg, valid: false background.js:2:112585
rule: ${host}/img_${index.padStart(3,0)}.${ext||xExt||xMimeExt||"jpg"}, filename: pbs.twimg.com/img_001.jpg, valid: true background.js:2:112585
createFilename ${host}/img_${index.padStart(3,0)}.${ext||xExt||xMimeExt||"jpg"} pbs.twimg.com/img_001.jpg background.js:2:112719
XHRGET
https://pbs.twimg.com/media/GK8IU8bbIAAOo8R?format=jpg&name=medium
[HTTP/2 200  54ms]

fetchDownload from Tab(13) 0.057s: images/stuff/pbs.twimg.com/img_001.jpg background.js:2:85904
saveDownload(13) from Tab(13): images/stuff/pbs.twimg.com/img_001.jpg background.js:2:87174
Download(13) interrupted: C:\Users\Miguel\Downloads\images\stuff\pbs.twimg.com\img_001.jpg background.js:2:83104
Window(1) has ended 114 background.js:2:110289
imagesFailed https://pbs.twimg.com/media/GK8IU8bbIAAOo8R?format=jpg&name=medium: images/stuff/pbs.twimg.com/img_001.jpg => undefined background.js:2:109497
0 Saved, 1 Failed

Download:

running 
Object { windowId: 1, tabId: 13, action: "active" }
background.js:2:133370
URL queued: https://pbs.twimg.com/media/GK8IU8bbIAAOo8R?format=jpg&name=medium background.js:2:119731
rule: ${name}.${ext}, filename: GK8IU8bbIAAOo8R., valid: false background.js:2:112585
rule: ${xName}.${xExt||xMimeExt}, filename: .jpg, valid: false background.js:2:112585
rule: ${host}/img_${index.padStart(3,0)}.${ext||xExt||xMimeExt||"jpg"}, filename: pbs.twimg.com/img_001.jpg, valid: true background.js:2:112585
createFilename ${host}/img_${index.padStart(3,0)}.${ext||xExt||xMimeExt||"jpg"} pbs.twimg.com/img_001.jpg background.js:2:112719
saveDownload(15) from Tab(13): images/stuff/pbs.twimg.com/img_001.jpg background.js:2:87174
Download(15) complete: C:\Users\Miguel\Downloads\images\stuff\pbs.twimg.com\img_001.jpg background.js:2:83104
Window(1) has ended 49 background.js:2:110289
1 Saved, 0 Failed

Funny thing is that after using it in download mode, if i change to another download method, they work now.. until i go to the folder where the images are and delete them (leaving the folder empty). It stops working again. And in this case i was trying on twitter which creates a folder called "pbs.twimg.com". Twitter can be working but if i try on a website that doesn't create a folder, it's not working anymore.

mcdamo commented 6 months ago

Lines Download(x) interrupted: ..., when it tries to save the downloaded image to your folder something is going wrong.

If you toggle the addon Sidebar, and try to download using the buttons in the Sidebar, does it show why it fails?

nikkopt commented 6 months ago

Thank you for your comment. It behaves the same as pressing the addon icon on the top bar. It doesn't show me any more info into why it fails, just this:

running 
Object { windowId: 1, tabId: 11, action: "active" }
background.js:2:133370
URL queued: https://i.imgur.com/8X3HR8X.jpeg background.js:2:119731
rule: ${name}.${ext}, filename: 8X3HR8X.jpeg, valid: true background.js:2:112585
createFilename ${name}.${ext} 8X3HR8X.jpeg background.js:2:112719
fetchDownload from Tab(11) 0.004s: images/stuff/8X3HR8X.jpeg background.js:2:85904
saveDownload(5) from Tab(11): images/stuff/8X3HR8X.jpeg background.js:2:87174
Download(5) interrupted: C:\Users\Miguel\Downloads\images\stuff\8X3HR8X.jpeg background.js:2:83104
Window(1) has ended 25 background.js:2:110289
imagesFailed https://i.imgur.com/8X3HR8X.jpeg: images/stuff/8X3HR8X.jpeg => undefined background.js:2:109497
0 Saved, 1 Failed background.js:2:108529
GET
https://i.imgur.com/8X3HR8X.jpeg

What is strange is that every time i test it to show you the logs, i try it on a different folder called "stuff". When i try it in the first try, the folder doesn't exist and if i save a picture it will save fine. If i go to that folder and delete the picture, leaving the folder empty, and i try to save the same picture (or one different) it will no longer save. Same when i change to my main pictures folder which is already full of pictures.. it won't save. It's like it only saves when the folder doesn't exist and only when i first start the browser.

Edit: As i was writing this i tried a fresh start on my browser and also deleted the folder but this time i can't make it work again.

nikkopt commented 6 months ago

I've tried both resetting the addon to its default values and also tried it on a fresh firefox profile. It doesn't help

mcdamo commented 6 months ago

Thankyou for your test details, I was able to confirm an intermittent crash that appears to be a Firefox bug.

I have added a workaround in v4.5.2 that appears to resolve it for me.

nikkopt commented 6 months ago

It seems to be working fine now. Crazy how a bug reported 4 years ago is still present. Thanks!