Regression on chrome to page to chrome interaction (wrappers?)

NEW
Assigned to

Status

8 years ago
4 years ago

People

(Reporter: sroussey, Assigned: sicking)

Tracking

Details

(URL)

(Reporter)

Description

8 years ago
User-Agent:       Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b11) Gecko/20100101 Firefox/4.0b11
Build Identifier: 

It looks like a wrapper issue

Reproducible: Always

Steps to Reproduce:
1. Install latest Firebug 1.7alpha (or SVN)
2. Install Illuminations beta: https://addons.mozilla.org/en-US/firefox/addon/illuminations-for-developers/versions/1.1.5beta3
3. Go here: http://dev.sencha.com/deploy/dev/examples/organizer/organizer.html
4. Enable Illuminations panel inside Firebug
5. Click on Data button
6. Click on the JsonStore
7. Click on the Records side panel

Works in Firefox 3.6 and it used to work in Firefox 4 as late as 1/18/2011 (I made a screencast that day, using Minefield). Broken in FF4b11
Actual Results:  
An error gets generated and therefore nothing shows in the records panel

Expected Results:  
Records show
(Reporter)

Comment 1

8 years ago
This might affect Firebug and other extensions

Comment 2

8 years ago
What is the error?
(Reporter)

Comment 3

8 years ago
TypeError 
	
fileName
	"http://dev.sencha.com/deploy/dev/ext-all.js"
	
lineNumber
	7
	
message
	"e.call is not a function"
	
name
	"TypeError"
	
stack
	"([object Proxy])@http://dev.sencha.com/deploy/dev/ext-all.js:7 @:0 "

It look like the callback function does not exist.

In extension:
object.data.each(function(record){...});

Comment 4

8 years ago
Ok, looks like this is a fallout from us making chrome Functions not expose any properties by default (which is an important security fix). The extension is going to have to fix this. Basically what we recommend doing is creating a content function that is bound to the chrome function. Take a look at the InstallTrigger and console API code in the browser for an example. Jonas, we really need documentation and developer outreach for this.

Updated

8 years ago
Assignee: nobody → jonas

Updated

8 years ago
Status: UNCONFIRMED → NEW
Ever confirmed: true

Updated

8 years ago
Component: General → Other
OS: Windows 7 → All
Product: Core → Tech Evangelism
QA Contact: general → other
Hardware: x86 → All
(Reporter)

Comment 5

8 years ago
Content page code (uncompressed):

each : function(fn, scope){
  var items = [].concat(this.items);
  for(var i = 0, len = items.length; i < len; i++){
    if(fn.call(scope || items[i], items[i], i, len) === false){
      break;
    }
  }
}

In this case it is fn.call is not a function

Comment 6

8 years ago
Is fn a function exposed by chrome?
(Reporter)

Comment 7

8 years ago
Something like this:

// find current window

win = window.wrappedJSObject;
object = win.Ext.StoreMgr.get("name");
object.data.each(function(record){...});

So the fn is visible, but not fn.call? 

OK, I'll ask somewhere about how the console API gets done (I *will* be at Mozilla Thursday morning, by chance). 

BTW: If you meant to cc Jonas, you didn't. Or he might find this some other way, in which case, never-mind.
(Reporter)

Comment 8

8 years ago
Oh, Jonas is there now

Comment 9

8 years ago
Yeah, so the chrome function is exposed, but content can't see any properties on it by default (in particular not fn.call/fn.apply/fn.bind).
(Reporter)

Comment 10

8 years ago
Thanks, I know you're busy. Rewriting around it.

Comment 11

8 years ago
I didn't mean to sound dismissive, Jonas is just more qualified to talk about this. I moved this over to evangelism to make sure we do communicate about this. You are not the first to run into this change.
(Reporter)

Comment 12

8 years ago
I didn't think you were dismissive at all. I appreciate brevity. And I'm following the work on quora & memory leaks. I was sincere when I said thanks!
Product: Tech Evangelism → Tech Evangelism Graveyard
You need to log in before you can comment on or make changes to this bug.