Closed Bug 333607 Opened 15 years ago Closed 14 years ago

Download Manager: contentAreaUtils.js error when saving link target

Categories

(Thunderbird :: Mail Window Front End, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED
Thunderbird2.0

People

(Reporter: osaier, Assigned: mscott)

References

(Blocks 1 open bug, )

Details

(Keywords: verified1.8.1.2)

Attachments

(4 files, 2 obsolete files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20060411 Firefox/3.0a1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20060411 Firefox/3.0a1

1. Subscribe to the above feed
2. Select an item, right-click the "Install" link at the bottom of the page, and "Save Link Target"

Reproducible: Always

Actual Results:  
Nothing happens, and the console reports: 
Error: Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIPrefBranch.getBoolPref]
Source file: chrome://communicator/content/contentAreaUtils.js
Line: 517

Expected Results:  
File is downloaded through TB's download manager

Left-clicking the link opens it in Firefox (my default browser)
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Target Milestone: --- → Thunderbird2.0
I think we are using xpfe's version of contentAreaUtils.js which is using obsolete (for thunderbird anyway) download prefs.

one solution could be to figure out how to use toolkit's version of this file. 
Attached patch switch to toolkit (obsolete) — Splinter Review
This seems to work.
Attachment #239199 - Flags: review?(mscott)
Attached patch switch to toolkit v2 (obsolete) — Splinter Review
Oops, I forgot to diff the changes in messageWindow.xul.
Attachment #239199 - Attachment is obsolete: true
Attachment #239230 - Flags: review?(mscott)
Attachment #239199 - Flags: review?(mscott)
*** Bug 334544 has been marked as a duplicate of this bug. ***
Comment on attachment 239230 [details] [diff] [review]
switch to toolkit v2

Hmm, I'm worried this is more complicated. contentAreaUtils.js is also loaded by xpfe\commiunicator\contentAreaContextOverlay.xul which is in turn loaded by thundebird's ab, 3-pane, and stand alone msg windows. 

Might take more clean up to get this to work.

Maybe we need to fork contentAreaContextOverlay.xul, make it a mail specific file like mozilla/suite did, and make that load global/content/contentAreautils.js.
Attachment #239230 - Flags: review?(mscott) → review-
Hm yes, forgot about xpfe... I suppose it's the same situation as with contentAreaClick.js.
Hm, why does thunderbird actually use this xul overlay file? The xul part of the code isn't used by Thunderbird; nsContextMenu.js and contentAreaCommands.dtd are loaded elsewhere. Did I miss something?
(In reply to comment #7)
> Hm, why does thunderbird actually use this xul overlay file? The xul part of
> the code isn't used by Thunderbird; nsContextMenu.js and
> contentAreaCommands.dtd are loaded elsewhere. Did I miss something?


I see it get loaded in two places:

http://lxr.mozilla.org/mozilla/source/mail/base/content/messenger.xul#47
and
http://lxr.mozilla.org/mozilla/source/mail/components/addrbook/content/addressbook.xul#43

Are you thinking we can remove those two lines?
Yes, I've been running Thunderbird in my local tree with those two lines commented out for some time now. I still have to check out litmus for some testcases (to prove that I didn't miss something).
(In reply to comment #9)
> Yes, I've been running Thunderbird in my local tree with those two lines
> commented out for some time now. I still have to check out litmus for some
> testcases (to prove that I didn't miss something).
> 

nice. And the context menus for html elements in the message pane still work good? i.e. on an image, a link, etc.?
I would like to be able to use trunk builds as my everyday newsreader.
But this is a real showstopper since hardly a day goes by that I don't need to save an inline image. It's been 6 months now. Can we get a fix or a dependable work-around.
see bug 334544 for more details, this effects more that RSS feeds and 'save ink as'
 
We might end up having to implement:

https://bugzilla.mozilla.org/show_bug.cgi?id=334544#c11

if we can't figure this out for thunderbird 2.
Attached patch new patchSplinter Review
I've built a fresh build and the context menus seem to work.
Attachment #239230 - Attachment is obsolete: true
The mail-jar.mn file is a bit different on the branch.
*** Bug 363630 has been marked as a duplicate of this bug. ***
I'm using TB-3a1 under ( Linux version ) and getting this bug also.
This bug is set as target for Thunderbird 2.0. Ziga any news about your patches? If they are ready can you request a review?
Blocks: 303545
Flags: blocking-thunderbird2?
I was trying out this patch before the holidays and was having some problems. Every time I try to save an image, I get the following JS error:

JavaScript error: chrome://communicator/content/nsContextMenu.js, line 527: save
URL is not defined

the weird thing is, it sure looks like we are including contentAreaUtils.js from toolkit where this gets defined.
Thanks for the feedback Scott. I'll test the patch again, but it worked in my local tree (I could save an image, save a link target, etc.). Have you tried with a clean build?

Henrik: Sorry if it hadn't been obvious, but I just wanted to get some feedback on the patch. XPFE to toolkit migrations are complicated and we sure want to avoid unnecessary regressions in this area.
Duplicate of this bug: 366260
bisi, just for grins, I checked this patch into the trunk (it wasn't going to make the problem worse) to see if a clean nightly build would work better than my debug build was with the patch. And I'm still getting the same errors reported in comment 18. Could I be missing part of your patch? 

2007-01-09 11:38	scott%scott-macgregor.org 	mozilla/mail/config/mail-jar.mn 	1.52 	1/2  	Bug #333607 --> download manager: unable to save link target. Try out bisi's patch on the trunk.
2007-01-09 11:38	scott%scott-macgregor.org 	mozilla/mail/components/addrbook/content/addressbook.xul 	1.67 	0/2 
2007-01-09 11:38	scott%scott-macgregor.org 	mozilla/mail/base/content/contentAreaClick.js 	1.12 	9/1 
2007-01-09 11:38	scott%scott-macgregor.org 	mozilla/mail/base/content/messageWindow.xul 	1.30 	1/1 
2007-01-09 11:38	scott%scott-macgregor.org 	mozilla/mail/base/content/messenger.xul 	1.67 	0/1 
Thanks for the trunk checkin; I've tested the latest trunk build this morning. I'm seeing the problem in the message pane (isContentFrame and SaveURL aren't defined; both in contentAreaUtils.js), but the message window gets it right - so it must be something with the message pane. Oops. :)

It looks like we also need to include contentAreaUtils.js in messenger.xul, but I won't be able to test this in my local tree until tomorrow.
Attached patch additional fixSplinter Review
ah that did it. thanks bisi. This is working for me now!
this is on the branch and trunk now. Thanks bisi.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Keywords: fixed1.8.1.2
Resolution: --- → FIXED
Flag not needed anymore.
Flags: blocking-thunderbird2?
Verified with

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a2pre) Gecko/20070111 Thunderbird/3.0a1 ID:2007011103

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1) Gecko/20061121 Thunderbird/2.0b1pre ID:2007011103
Status: RESOLVED → VERIFIED
Component: General → Mail Window Front End
OS: Windows XP → All
Hardware: PC → All
Version: unspecified → Trunk
Duplicate of this bug: 367151
Follow-up: bug 368914.
Duplicate of this bug: 286871
Duplicate of this bug: 287526
You need to log in before you can comment on or make changes to this bug.