Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

requestpolicy 0.5.8 breaks opening new tab in latest minefield trunk builds #38

Closed
jsamuel opened this issue Dec 22, 2011 · 3 comments
Closed

Comments

@jsamuel
Copy link
Member

jsamuel commented Dec 22, 2011

imported trac ticket
created: 2009-09-16 12:54:51
reporter: aja

0.5.8 breaks opening of new tabs (via context menu, or otherwise) with latest trunk nightly:
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.3a1pre) Gecko/20090915 Minefield/3.7a1pre ID:20090915053258

I get the following in Console2:
Error: '[JavaScript Error: "uri is null" {file: "file:///C:/Documents%20and%20Settings/Aja/Application%20Data/Mozilla/Firefox/Profiles/y5aydfee.central/extensions/requestpolicy@requestpolicy.com/modules/DomainUtil.jsm" line: 186}]' when calling method: [nsIRequestPolicy::registerLinkClicked] = NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS
Source file: chrome://requestpolicy/content/overlay.js
Line: 844

which refers to this line:
this._rpService.registerLinkClicked(referrerUri.spec, tabUri);

This was reported in firefox builds forum here:
viewtopic.php?p=7522705#p7522705

@jsamuel
Copy link
Member Author

jsamuel commented Dec 22, 2011

imported trac comment
created: 2009-09-16 13:31:32
author: justin

Thanks for providing this bug report, Aja. I started looking into it this morning (saw the mozillazine post of yours) but I still haven't had a chance to look at everything I need to.

Here's what see so far.

The gBrowser.addTab function whose signature looks like this:

{{{
function addTab(aURI, aReferrerURI, aCharset, aPostData, aOwner, aAllowThirdPartyFixup)
}}}

Now seems to be passing an object in the aReferrerURI that looks like this rather than being an nsIURI:

{{{
[object Object]
=> key: referrerURI / value: null
=> key: charset / value: null
=> key: postData / value: null
=> key: ownerTab / value: [object XULElement]
=> key: allowThirdPartyFixup / value: false
=> key: relatedToCurrent / value: undefined
}}}

And the aReferrerURI.referrerURI is what used to be in the aReferrerURI argument.

However, before you think I'm saying it's a change in functionality in Firefox or a bug in Firefox, note the really odd part that the attributes of aReferrerURI look a lot like the arguments that were supposed to be passed to addTab. This makes me think that there may be a bug in RequestPolicy. There's some horrible code related to modifying addTab that I had to use because TabMixPlus has some horrible code for modifying addTab and I couldn't retain compatibility without doing it their way (I'm not sure if they have a good reason for the way they did it, so I'm not judging, just saying it's horrible and I hope it was a last resort).

So, what I need to do when I have time (probably tomorrow morning) is to dig into this more to see if the way addTab() is being called by Firefox has really changed or if this is a side effect of the bad way that I'm wrapping addTab().

@jsamuel
Copy link
Member Author

jsamuel commented Dec 22, 2011

imported trac comment
created: 2009-09-16 19:31:48
author: justin

Here is the source of the problem, a change in the tabbrowser.addTab function:

http://hg.mozilla.org/mozilla-central/rev/0137837043e0

https://bugzilla.mozilla.org/show_bug.cgi?id=515932

I'll work on a fix for this in the next day or two.

By the way, I should mention that I didn't mean any offense to the !TabMixPlus folks. I took a look at their code again (it's been a long time since I looked at it) and I'm not sure how they'd do anything differently. As ugly as it is, their hands may be tied. Maybe down the road I'll try to coordinate with them to make it easier for extensions like !RequestPolicy to coexist with !TabMixPlus without having to uglify our code, as well.

@jsamuel
Copy link
Member Author

jsamuel commented Dec 22, 2011

imported trac comment
created: 2009-09-18 09:35:41
author: justin

Fixed in r269. Will be included in 0.5.9, possibly released this weekend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant