Infocatcher / Link_Properties_Plus

Provides extended link properties: size of linked file, last modified time, etc., extension for Firefox, SeaMonkey and Thunderbird
https://addons.mozilla.org/addon/link-properties-plus/
Other
10 stars 3 forks source link

Error after clicking on download-link #7

Closed hurda closed 10 years ago

hurda commented 10 years ago

After clicking on a download link, the following error is shown in the browser console:

Timestamp: 07.10.2013 20:09:11
Error: [Exception... "Component returned failure code: 0x80004002 (NS_NOINTERFACE) [nsISupports.QueryInterface]"  nsresult: "0x80004002 (NS_NOINTERFACE)"  location: "JS frame :: chrome://linkpropsplus/content/linkPropsPlus.js :: linkPropsPlusSvc.realReferer :: line 821"  data: no]
Source File: chrome://linkpropsplus/content/linkPropsPlus.js
Line: 825

This happens with at least Firefox 23 and 24 in a new profile with only LPP 1.5.2 installed. This bug also has negative effects on other addons like TabMix Plus 0.4.1.2.

hurda commented 10 years ago

This is only happening with certain links, i.e. .doc The error doesn't happen with exe, zip and 7z files. Maybe it got something to do with the file-associations?

Infocatcher commented 10 years ago

This is only happening with certain links, i.e. .doc

Can't reproduce... What about link example?

Also this error may be not critical: it's reported manually and there is alternative way to get URL for HTTP referer. So, what you see in the download dialog?

Also please try debug version: link_properties_plus-1.5.3pre2-debug.xpi. Source code: latest development version +

--- a/chrome/content/linkPropsPlus.js
+++ b/chrome/content/linkPropsPlus.js
@@ -900,6 +900,29 @@
            return this.wnd.referer;

        try {
+           var refNav = dialog.mContext
+               .QueryInterface(Components.interfaces.nsIWebNavigation)
+               .currentURI.spec;
+       }
+       catch(e) {
+           refNav = "!error: " + e;
+       }
+       try {
+           var refDoc = this.sourceDocument.documentURI;
+       }
+       catch(e) {
+           refDoc = "!error: " + e;
+       }
+       Components.classes["@mozilla.org/consoleservice;1"]
+           .getService(Components.interfaces.nsIConsoleService)
+           .logStringMessage(
+               "[Link Properties Plus]: get realReferer():"
+               + "\nFrom nsIWebNavigation: " + refNav
+               + "\nFrom source document: " + refDoc
+               + "\nEquals: " + (refNav == refDoc)
+           );
+
+       try {
            return dialog.mContext
                .QueryInterface(Components.interfaces.nsIWebNavigation)
                .currentURI.spec;
hurda commented 10 years ago

Sorry, example page: http://www.fia.com/championship/fia-formula-1-world-championship/2013/2013-hungarian-grand-prix-event-information

It happens when I click on any of the PDF-links. You'll have to set Firefox to "always ask to save" instead of "preview in firefox".

And the error is also happening with 1.53pre2:

[Link Properties Plus]: get realReferer():
From nsIWebNavigation: !error: [Exception... "Component returned failure code: 0x80004002 (NS_NOINTERFACE) [nsISupports.QueryInterface]"  nsresult: "0x80004002 (NS_NOINTERFACE)"  location: "JS frame :: chrome://linkpropsplus/content/linkPropsPlus.js :: linkPropsPlusSvc.realReferer :: line 904"  data: no]
From source document: http://www.fia.com/championship/fia-formula-1-world-championship/2013/2013-hungarian-grand-prix-event-information
Equals: false
Timestamp: 08.10.2013 11:44:15
Error: [Exception... "Component returned failure code: 0x80004002 (NS_NOINTERFACE) [nsISupports.QueryInterface]"  nsresult: "0x80004002 (NS_NOINTERFACE)"  location: "JS frame :: chrome://linkpropsplus/content/linkPropsPlus.js :: linkPropsPlusSvc.realReferer :: line 927"  data: no]
Source File: chrome://linkpropsplus/content/linkPropsPlus.js
Line: 931
hurda commented 10 years ago

New profile, no other addons but LPP are active, no plugins are active, no settings have been changed except for the "always aks"- setting for PDF in Options/Applications.

Infocatcher commented 10 years ago

example page: http://www.fia.com/championship/fia-formula-1-world-championship/2013/2013-hungarian-grand-prix-event-information

Thanks, now I see. But all other works fine for me (I see described error, but I also see all link properties)... And should works for you, because I see correct referer/referrer in

From source document: http://www.fia.com/championship/fia-formula-1-world-championship/2013/2013-hungarian-grand-prix-event-information

Code about download dialog is based on code from FlashGot extension (because it's easer to found examples there – I don't know about any documentation), but LPP also log errors into Error Console.

I suppressed error message, if alternative method works: ca8df9cef979c98da98ee5ebefe773ec6f9388c3 Test version: link_properties_plus-1.5.3pre2-fx-sm-tb.xpi (source).

hurda commented 10 years ago

Yes, no more errors with that version. Thank you.

Infocatcher commented 10 years ago

Can be closed, I think. :)