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

Use __exposedProps__ #1595

Closed
arantius opened this issue Aug 1, 2012 · 6 comments
Closed

Use __exposedProps__ #1595

arantius opened this issue Aug 1, 2012 · 6 comments
Milestone

Comments

@arantius
Copy link
Collaborator

arantius commented Aug 1, 2012

Firefox 15 gives an error like:

Error: Exposing chrome JS objects to content without __exposedProps__ is insecure and deprecated. See https://developer.mozilla.org/en/XPConnect_wrappers for more information.
Source File: resource://greasemonkey/runScript.js
Line: 28

When running scripts.

@arantius
Copy link
Collaborator Author

It no longer does. Closing this WAI.

@arantius arantius reopened this Aug 20, 2012
@arantius
Copy link
Collaborator Author

See #1607; this does appear to still matter, at least for GM_xhr.

arantius added a commit to arantius/greasemonkey that referenced this issue Aug 30, 2012
@arantius
Copy link
Collaborator Author

After the fix linked above for #1607, this seems to be done. My tests show that all of the other API methods act as expected; I believe because they always return nothing, or standard string/array objects, and:

https://blog.mozilla.org/addons/2012/08/20/exposing-objects-to-content-safely/

If all you’re doing is passing values like numbers, booleans or strings, they should continue to work.

@bananastalktome
Copy link

I am getting the same exposedProps error when attempting to iterate over the array returned by GM_listValues().

The following simple script shows the issue:

// ==UserScript==
// @name        Demonstrate __exposedProps__ warning
// @namespace   personal
// @include     SITE_URL
// @require     https://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js
// @require      https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.23/jquery-ui.min.js
// @grant        GM_listValues
// @version     1
// ==/UserScript==

var gmValues = GM_listValues();

gmValues.forEach(function(val, index){
  console.log(val);
});

The console shows:

Exposing chrome JS objects to content without exposedProps is insecure and deprecated. See https://developer.mozilla.org/en/XPConnect_wrappers for more information.

draftKeys.forEach(function(val, index){

Additional Details: OSX 10.8.1, Firefox 15.0.1, GreaseMonkey 1.1

Thanks

@arantius
Copy link
Collaborator Author

It would be helpful if you report this as its own separate issue.

@bananastalktome
Copy link

@arantius good call, in #1637

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

No branches or pull requests

2 participants