I finally got this down. What was happening was that in the framescript I was loading a subscript call Comm.js. I think I didn’t ask the question clearly and should have mentioned that the quirk was seen when was using loadSubScript
.
Now this subscript was able to access properties set on this.xxx
however if I did var xxx
it would not be able to access it.
So what I did was in the framescript I removed all code and put it to subscript:
Services.scriptloader.loadSubScript('chrome://comm/content/resources/scripts/Comm/Comm.js');
Services.scriptloader.loadSubScript('chrome://comm/content/resources/scripts/MainFramescriptSubscript.js');
Now Comm.js
can access globals var xxx
as if it were this.xxx
I think this is unique the loadSubScript, as in the framescript itself, if I set this.xxx = true
I can access it with xxx
or this.xxx
.
Seen here: