Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: href in XUL label - linking borked in TB3?

22 views
Skip to first unread message

Axel Grude

unread,
Dec 21, 2009, 4:32:43 AM12/21/09
to
Neil wrote:
> Axel Grude wrote:
>
>> Also, is it possible to use the title attribute in order to generate
>> tooltip messages over the labels?
>>
>>
> Use tooltiptext for all XUL tooltip titles. (Use tooltip if you want to
> be able to dynamically modify the tooltip.)
>
Thanks Neil,

the tooltips is at least a workaround; I still fear there is a bug with
links in the latest TB build:

The homepage link from my install.rdf is broken (works on all other
Thunderbird versions). This is configured like this:


<RDF:Description RDF:about="urn:mozilla:install-manifest"
em:id="quickf...@curious.be"
[..stuff snipped...]
em:homepageURL="http://quickfolders.mozdev.org/index.html">

Labels in an options dialog that contain a href to a web site do not
open the link in the configured browser anymore.

Instead they throw this error:


No chrome package registered for chrome://navigator/content/navigator.xul
----------


Error: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE)
[nsIDOMJSWindow.open]
Source file: chrome://global/content/bindings/text.xml
Line: 353

the line that fails is:
if (uri)
win.open(uri.spec);

Philip Chee

unread,
Dec 21, 2009, 9:32:12 AM12/21/09
to
On Mon, 21 Dec 2009 09:32:43 +0000, Axel Grude wrote:

> Labels in an options dialog that contain a href to a web site do not
> open the link in the configured browser anymore.
>
> Instead they throw this error:
>
> No chrome package registered for chrome://navigator/content/navigator.xul
> ----------
>
>
> Error: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE)
> [nsIDOMJSWindow.open]
> Source file: chrome://global/content/bindings/text.xml
> Line: 353
>
> the line that fails is:
> if (uri)
> win.open(uri.spec);

In Thunderbird < 3.0, http:// was an external protocol so the external
protocol handler was called to hand off the url to your systems default
browser.

In 3.0 http became an exposed protocol so Thunderbird tries to handle
this internally. I'm still not sure why this problem occurs since you
are not on a Mac.

In:
http://mxr.mozilla.org/comm-1.9.1/source/mail/base/content/utilityOverlay.js#51
There is:

function getBrowserURL() {

try {
var prefs = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch);
var url = prefs.getCharPref("browser.chromeURL");
if (url)
return url;
} catch(e) {
}
return "chrome://navigator/content/navigator.xul";
}

But I'm not sure how this is invoked.

Phil


--
Philip Chee <phi...@aleytys.pc.my>, <phili...@gmail.com>
http://flashblock.mozdev.org/ http://xsidebar.mozdev.org
Guard us from the she-wolf and the wolf, and guard us from the thief,
oh Night, and so be good for us to pass.

Axel Grude

unread,
Dec 22, 2009, 3:04:02 AM12/22/09
to
Philip Chee wrote:
> On Mon, 21 Dec 2009 09:32:43 +0000, Axel Grude wrote:
>
>> Labels in an options dialog that contain a href to a web site do not
>> open the link in the configured browser anymore.
>>
>> Instead they throw this error:
>>
>> No chrome package registered for chrome://navigator/content/navigator.xul
>> ----------
>>
>>
>> Error: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE)
>> [nsIDOMJSWindow.open]
>> Source file: chrome://global/content/bindings/text.xml
>> Line: 353
>>
>> the line that fails is:
>> if (uri)
>> win.open(uri.spec);

Hi Phil, maybe it helps if I give you more of the Javascript log detail
- I have just installed Venkman to debug the call as well.

Error Console Output:

No chrome package registered for

chrome://browser/content/contentAreaUtils.js
----------
Error: [Exception... "Component returned failure code: 0x80040154
(NS_ERROR_FACTORY_NOT_REGISTERED) [nsIDocShellHistory.useGlobalHistory]"
nsresult: "0x80040154 (NS_ERROR_FACTORY_NOT_REGISTERED)" location: "JS
frame :: chrome://global/content/bindings/browser.xml :: :: line 643"
data: no]
Source file: chrome://global/content/bindings/browser.xml
Line: 647
----------
Warning: Error in parsing value for 'white-space'. Declaration dropped.
Source file: chrome://venkman/content/venkman-output-base.css
Line: 58
----------
QuickFolders:Exception in initDelayed: TypeError:
document.getElementById("QuickFolders-Toolbar") is null
----------


No chrome package registered for chrome://navigator/content/navigator.xul
----------
Error: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE)
[nsIDOMJSWindow.open]
Source file: chrome://global/content/bindings/text.xml
Line: 353

----------


No chrome package registered for

chrome://browser/skin/extensions/icons/console2-css.png


> In 3.0 http became an exposed protocol so Thunderbird tries to handle
> this internally. I'm still not sure why this problem occurs since you
> are not on a Mac.


is it possible to set a breakpont in text.xml ? Some way to display the
URI generated by ioService?

ALso, if the same version is part of SeaMonkey 2.0 is it possible to
compare here - guess it depends on whether I can debug text.xml...
- I also wonder whether win.open(href) would have worked...

code in (my) text.xml:

var href = this.href;
if (!href || this.disabled || aEvent.getPreventDefault())
return;

var uri = null;
try {
const nsISSM = Components.interfaces.nsIScriptSecurityManager;
const secMan =

Components.classes["@mozilla.org/scriptsecuritymanager;1"]
.getService(nsISSM);

const ioService =
Components.classes["@mozilla.org/network/io-service;1"]

.getService(Components.interfaces.nsIIOService);

uri = ioService.newURI(href, null, null);

var nullPrincipal =
Components.classes["@mozilla.org/nullprincipal;1"]
.createInstance(Components.interfaces.nsIPrincipal);
try {
secMan.checkLoadURIWithPrincipal(nullPrincipal, uri,

nsISSM.DISALLOW_INHERIT_PRINCIPAL)
}
catch (ex) {
var msg = "Error: Cannot open a " + uri.scheme + ": link
using \
the text-link binding.";
Components.utils.reportError(msg);
return;
}

const cID =
"@mozilla.org/uriloader/external-protocol-service;1";
const nsIEPS = Components.interfaces.nsIExternalProtocolService;
var protocolSvc = Components.classes[cID].getService(nsIEPS);

// if the scheme is not an exposed protocol, then opening
this link
// should be deferred to the system's external protocol handler
if (!protocolSvc.isExposedProtocol(uri.scheme)) {
protocolSvc.loadUrl(uri);
aEvent.preventDefault()
return;
}

}
catch (ex) {
Components.utils.reportError(ex);
}

// otherwise, fall back to opening the anchor directly
var win = window;
if (window instanceof Components.interfaces.nsIDOMChromeWindow) {
while (win.opener && !win.opener.closed)
win = win.opener;
}

if (uri)
win.open(uri.spec);
else
win.open(href);

aEvent.preventDefault();

Neil

unread,
Dec 22, 2009, 4:20:51 AM12/22/09
to
Philip Chee wrote:

>In 3.0 http became an exposed protocol so Thunderbird tries to handle this internally. I'm still not sure why this problem occurs since you are not on a Mac.
>
>

Because the <label> tries to use window.open and Thunderbird probably
doesn't support that, although I haven't tried.

--
Warning: May contain traces of nuts.

Axel Grude

unread,
Dec 25, 2009, 2:45:08 PM12/25/09
to
Neil wrote:
> Philip Chee wrote:
>
>> In 3.0 http became an exposed protocol so Thunderbird tries to handle
>> this internally. I'm still not sure why this problem occurs since you
>> are not on a Mac.
>>
>>
> Because the <label> tries to use window.open and Thunderbird probably
> doesn't support that, although I haven't tried.
>
Well it used to, in TB2 and older TB3 versions. Whether this is
semantically correct, I wouldn't know.
0 new messages