Last Comment Bug 834697 - Enable XBL Scopes
: Enable XBL Scopes
Status: RESOLVED FIXED
: addon-compat, dev-doc-needed
Product: Core
Classification: Components
Component: XPConnect (show other bugs)
: unspecified
: x86 Mac OS X
: -- normal with 1 vote (vote)
: mozilla21
Assigned To: Bobby Holley (:bholley) (busy with Stylo)
:
Mentors:
Depends on: XBL-scopes 843470 844211 844783 845555 846763 865947
Blocks: 236839 264817 208864 449358 790732 816071 817922 821676 825392 834699 842372
  Show dependency treegraph
 
Reported: 2013-01-25 06:29 PST by Bobby Holley (:bholley) (busy with Stylo)
Modified: 2014-03-18 06:13 PDT (History)
16 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
-


Attachments

Description Bobby Holley (:bholley) (busy with Stylo) 2013-01-25 06:29:45 PST
In bug 821850 I'm landing machinery to run content XBL in a separate scope, but I'm going to land it prefed off. This bug is for flipping that pref.
Comment 1 Bobby Holley (:bholley) (busy with Stylo) 2013-02-10 08:46:21 PST
To be clear: These deps were inherited from bug 821850. I moved them here because that more accurately reflects the reality in a pref-oriented world.
Comment 2 Bobby Holley (:bholley) (busy with Stylo) 2013-02-14 02:57:58 PST
https://hg.mozilla.org/integration/mozilla-inbound/rev/a0928943de65

\o/
Comment 4 Bobby Holley (:bholley) (busy with Stylo) 2013-02-14 06:10:45 PST
Oh yeah, that's a known bug, actually (bug 834732), but more or less orthogonal to this patch. I'm going to reland with that assertion disabled and re-enable it in bug 834732.
Comment 5 Bobby Holley (:bholley) (busy with Stylo) 2013-02-14 06:16:58 PST
https://hg.mozilla.org/integration/mozilla-inbound/rev/c7d8ac7fbe29
Comment 6 Ryan VanderMeulen [:RyanVM] 2013-02-14 14:23:03 PST
https://hg.mozilla.org/mozilla-central/rev/c7d8ac7fbe29
Comment 7 Jim Jeffery not reading bug-mail 1/2/11 2013-02-15 17:33:18 PST
Probably expected perhaps, but this broke the FlashBlock Addon.  I've filed a bug with the addon dev and flipped the pref back off manually for now.
Comment 8 Philip Chee 2013-02-15 20:42:03 PST
> Probably expected perhaps, but this broke the FlashBlock Addon.  I've filed a bug with
> the addon dev and flipped the pref back off manually for now.
I'm already CCed to this bug and to bug 821850. 821850 was intended not to break Flashblock. Are you testing with the latest nightly?
Comment 9 Jim Jeffery not reading bug-mail 1/2/11 2013-02-16 01:46:48 PST
(In reply to Philip Chee from comment #8)
> > Probably expected perhaps, but this broke the FlashBlock Addon.  I've filed a bug with
> > the addon dev and flipped the pref back off manually for now.
> I'm already CCed to this bug and to bug 821850. 821850 was intended not to
> break Flashblock. Are you testing with the latest nightly?

Yes, well latest m-c hourly based on cset:
https://hg.mozilla.org/mozilla-central/rev/7bd555e2acfa
win7 x64
Comment 10 Philip Chee 2013-02-16 04:52:58 PST
I see it now:
Sat Feb 16 2013 20:40:32
Error: Error: Permission denied to access property 'length'
Source file: chrome://flashblock/content/flashblock.xml
Line: 21

//From Jesse's XPCNativeWrapper: http://mavra.perilith.com/~luser/content/native.js
function nativeMethod(untrustedObject, methodName)
{
  // happier stack traces and faster multiple calls
  var fun = Components.lookupMethod(untrustedObject, methodName);
  
  return function()
  {
    return fun.apply(untrustedObject, arguments); <---- line 21
  }
}

But I don't see this error in my local SeaMonkey trunk build. I have:
dom.xbl_scopes = true
In both Firefox nightly and my self-build comm-central SeaMonkey.

Firefox:
Vendor=Mozilla
Name=Firefox
Version=21.0a1
BuildID=20130215031040
SourceRepository=http://hg.mozilla.org/mozilla-central
SourceStamp=953b1db7a246 

SeaMonkey:
Vendor=Mozilla
Name=SeaMonkey
Version=2.18a1
BuildID=20130216181125
SourceRepository=read config from: c:\DEV\mozilla-build\hg\mercurial.ini
SourceStamp=31927ec3e589
Comment 11 Bobby Holley (:bholley) (busy with Stylo) 2013-02-18 07:16:04 PST
(In reply to Philip Chee from comment #10)
> I see it now:
> Sat Feb 16 2013 20:40:32
> Error: Error: Permission denied to access property 'length'
> Source file: chrome://flashblock/content/flashblock.xml
> Line: 21
> 
> //From Jesse's XPCNativeWrapper:
> http://mavra.perilith.com/~luser/content/native.js
> function nativeMethod(untrustedObject, methodName)

As a matter of fact, with xbl scopes enabled, you don't need nativeMethod / lookupMethod at all anymore, because XBL-in-content now runs in a separate compartment and gets Xray vision when accessing content objects (much like chrome code gets). So you can probably just detect whether your XBL is running in a separate compartment, and if so, skip the nativeMethod stuff.

The easiest way to check whether you're running with Xray vision is probably to check XPCNativeWrapper.unwrap(window) != window. Give that a try?
Comment 12 Philip Chee 2013-02-19 08:48:06 PST
> The easiest way to check whether you're running with Xray vision is probably to check
> XPCNativeWrapper.unwrap(window) != window. Give that a try?
Will do. Thanks.
Comment 13 bhavana bajaj [:bajaj] 2013-04-02 11:42:39 PDT
Not release noting in Fx 21 release notes as this impacts addon-compat & will be covered in an addon blog by :jorgev per https://bugzilla.mozilla.org/show_bug.cgi?id=844783#c6

Please let me know if this needs to be in both the with reasoning on the impact & feel free to renominate it with relnote : ?
Comment 14 Masayuki Nakano [:masayuki] (Mozilla Japan) 2014-03-17 22:09:32 PDT
I have a question, there are some bugs which are blocked by this bug such as bug 208864. Why are they still open? At least, looks like bug 208864 has been fixed.
Comment 15 Bobby Holley (:bholley) (busy with Stylo) 2014-03-18 06:13:39 PDT
(In reply to Masayuki Nakano (:masayuki) (Mozilla Japan) from comment #14)
> I have a question, there are some bugs which are blocked by this bug such as
> bug 208864. Why are they still open? At least, looks like bug 208864 has
> been fixed.

Many of them could probably be closed, either due to this bug or bug 840488. People just need to go through them and verify that there's nothing more to do.

Note You need to log in before you can comment on or make changes to this bug.