[Beta1] Can't get "currentset" from browser.xul#nav-bar Topic is solved

This board is for discussions, bug reports, etc. for pre-releases of the v27 milestone codenamed "Tycho".

Since the beta phase is over, this board is closed for new posts/topics.
JustOff

[Beta1] Can't get "currentset" from browser.xul#nav-bar

Unread post by JustOff » 2016-10-05, 22:02

I use following code in my addon to get "currentset" from browser.xul#nav-bar:

Code: Select all

RDF = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService);
lstore = Components.classes["@mozilla.org/rdf/datasource;1?name=local-store"].getService(Components.interfaces.nsIRDFDataSource);
lstore.GetTarget(RDF.GetResource("chrome://browser/content/browser.xul#nav-bar"), RDF.GetResource("currentset"), true);
In Beta1 this return null, while up to Alpha2 there was instanceof nsIRDFLiteral. Did I miss something?

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35602
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: [Beta1] Can't get "currentset" from browser.xul#nav-bar

Unread post by Moonchild » 2016-10-06, 08:56

I don't see a reason why this would suddenly fail in the beta...
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

JustOff

Re: [Beta1] Can't get "currentset" from browser.xul#nav-bar

Unread post by JustOff » 2016-10-06, 11:25

But it does fail :crazy:

Could anyone else confirm it?

The simplest way to do that is run the Scratchpad (Shift+F4), type "allow pasting" to allow pasting from clipboard, then copy the code below and press "Display".

New Tobin Paradigm

Re: [Beta1] Can't get "currentset" from browser.xul#nav-bar

Unread post by New Tobin Paradigm » 2016-10-06, 12:07

Could the statusbar code bindings be blocking this?

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35602
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: [Beta1] Can't get "currentset" from browser.xul#nav-bar

Unread post by Moonchild » 2016-10-06, 12:07

I'm unable to confirm because Scratchpad apparently doesn't want to give me the option to run in the browser context, fnar.

What I was saying is that I don't really see a reason why there would be a difference -- this stuff hasn't actually been changed between A2 and B1, afaict.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35602
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: [Beta1] Can't get "currentset" from browser.xul#nav-bar

Unread post by Moonchild » 2016-10-06, 12:08

Matt A Tobin wrote:Could the statusbar code bindings be blocking this?
That's a good question.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

JustOff

Re: [Beta1] Can't get "currentset" from browser.xul#nav-bar

Unread post by JustOff » 2016-10-06, 12:21

Moonchild wrote:I'm unable to confirm because Scratchpad apparently doesn't want to give me the option to run in the browser context, fnar.
Another way to test it is Firebug console, opened for example from "about:addons" tab, in Alpha2 all is ok:

Code: Select all

>>> RDF = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService)
Object { QueryInterface=QueryInterface(),  GetResource=GetResource(),  GetUnicodeResource=GetUnicodeResource(),  more...}
>>> lstore = Components.classes["@mozilla.org/rdf/datasource;1?name=local-store"].getService(Components.interfaces.nsIRDFDataSource)
Object { URI="rdf:local-store",  QueryInterface=QueryInterface(),  GetSource=GetSource(),  more...}
>>> lstore.GetTarget(RDF.GetResource("chrome://browser/content/browser.xul#nav-bar"), RDF.GetResource("currentset"), true)
Object { QueryInterface=QueryInterface(),  EqualsNode=EqualsNode()}
but in Beta1 is not:

Code: Select all

>>> RDF = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService)
Object { QueryInterface=QueryInterface(),  GetResource=GetResource(),  GetUnicodeResource=GetUnicodeResource(),  more...}
>>> lstore = Components.classes["@mozilla.org/rdf/datasource;1?name=local-store"].getService(Components.interfaces.nsIRDFDataSource)
Object { URI="rdf:local-store",  QueryInterface=QueryInterface(),  GetSource=GetSource(),  more...}
>>> lstore.GetTarget(RDF.GetResource("chrome://browser/content/browser.xul#nav-bar"), RDF.GetResource("currentset"), true)
null

New Tobin Paradigm

Re: [Beta1] Can't get "currentset" from browser.xul#nav-bar

Unread post by New Tobin Paradigm » 2016-10-06, 12:34

Are you Windows or Linux? And can you give this a try on current release.. I will ifdef out statusbar and create you a build to see if we can at least rule it out..

JustOff

Re: [Beta1] Can't get "currentset" from browser.xul#nav-bar

Unread post by JustOff » 2016-10-06, 12:43

Matt A Tobin wrote:Are you Windows or Linux?
Windows 7x64

New Tobin Paradigm

Re: [Beta1] Can't get "currentset" from browser.xul#nav-bar

Unread post by New Tobin Paradigm » 2016-10-06, 12:53

Alright I will create a build without statusbar code which means the bindings won't be there.. See if that is blocking your code.. In the meantime please see if this works on current-release, would you?

JustOff

Re: [Beta1] Can't get "currentset" from browser.xul#nav-bar

Unread post by JustOff » 2016-10-06, 12:58

Yes, of course I will.

New Tobin Paradigm

Re: [Beta1] Can't get "currentset" from browser.xul#nav-bar

Unread post by New Tobin Paradigm » 2016-10-06, 13:26

Have you actually tried this code in an actual chrome space with an extension? Maybe the scratchpad and similar are just.. not the right tool.

JustOff

Re: [Beta1] Can't get "currentset" from browser.xul#nav-bar

Unread post by JustOff » 2016-10-06, 13:30

Yes, the particular problem with extension was the cause of further investigations.

New Tobin Paradigm

Re: [Beta1] Can't get "currentset" from browser.xul#nav-bar

Unread post by New Tobin Paradigm » 2016-10-06, 13:35

Alright, have you tested to see if this works in current-release of Pale Moon yet? In fact could you come to our IRC channel either by links on the website or irc.freenode.net #palemoon.. This is getting a bit back and forth for the forum.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35602
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: [Beta1] Can't get "currentset" from browser.xul#nav-bar

Unread post by Moonchild » 2016-10-06, 14:07

I've looked at this, still not any closer to a solution.
  • PM-release does this fine, returns a wrapped xpcom object
  • I've tried reversing the WrappedJS optimization I put in (to immediately release wrappedjs objects when they are dying), made no difference.
  • I've tried reversing the sessionstore promise.js change just in case by some weird coincidence it would cause this, made no difference.
  • I've looked through other commits between A2 and B1 and don't really see anything else apart from the status bar change that even comes close to touching this directly.
Pinpointing the commit where this changed via bisection is likely the only way to get to it if the status bar change is also a no-go.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

New Tobin Paradigm

Re: [Beta1] Can't get "currentset" from browser.xul#nav-bar

Unread post by New Tobin Paradigm » 2016-10-06, 14:37

Statusbar isn't responsible for this.. The only major thing beyond places bugfixes I see is devtools.. So trying without devtools.

New Tobin Paradigm

Re: [Beta1] Can't get "currentset" from browser.xul#nav-bar

Unread post by New Tobin Paradigm » 2016-10-06, 14:48

Nope joy there either...

New Tobin Paradigm

Re: [Beta1] Can't get "currentset" from browser.xul#nav-bar

Unread post by New Tobin Paradigm » 2016-10-06, 14:57

Alright.. so catchup.. This involves the extension Active Stop Button.. The developer is JustOff.. The issue happens when he has the reload and stop button at the end of the location bar but inserts a toolbar item provided by the extension called "Zero Space".. This issue happens on startup as going into customization mode and coming out resolves it. The control looks on startup to not be properly initialized and you get into a conflicting state where the code that morphs the reload/stop into the location bar works but then that Zero Space element then the reload button appears.

The code in question failing causes the Zero Space element to not work correctly and you get into this odd state. The actual results SHOULD be that the Zero Space element should prevent the location bar from eating the reload and stop button keeping them as actual buttons.

What is concerning is that not being able to get the result he wants from the code could also break other extensions as well.. Apparently a similar regression happened in Firefox 25 and up but it is odd that this isn't an issue in Alpha 2 but is in Beta 1.. The DevTools and the Status Bar code has been ruled out as possibilities.

JustOff

Re: [Beta1] Can't get "currentset" from browser.xul#nav-bar

Unread post by JustOff » 2016-10-06, 15:04

Actually the particular extension isn't a big deal, I suppose I'll find the workaround, I've already have workaround, but I'm worried about the error itself - what else could be broken too?

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35602
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: [Beta1] Can't get "currentset" from browser.xul#nav-bar

Unread post by Moonchild » 2016-10-06, 15:19

Matt A Tobin wrote:The issue happens when he has the reload and stop button at the end of the location bar but inserts a toolbar item provided by the extension called "Zero Space".. This issue happens on startup as going into customization mode and coming out resolves it.
So, is it some lazy module-loading causing an issue, then?

The only other thing potentially touching this is the changes we made to js/xpconnect to enable the shared js lib.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

Locked