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

Support cloneInto, createObjectIn, exportFunction #1875

Closed
theseanl opened this issue Aug 4, 2017 · 4 comments
Closed

Support cloneInto, createObjectIn, exportFunction #1875

theseanl opened this issue Aug 4, 2017 · 4 comments
Assignees
Milestone

Comments

@theseanl
Copy link

theseanl commented Aug 4, 2017

Steps to reproduce

  1. Add a following userscript to AG for Win extensions module.
// ==UserScript==
// @name        cloneInto test
// @namespace   test
// @match     http://*/*
// @match     https://*/*
// @grant       unsafeWindow
// ==/UserScript==

var object = { "key": "value" };

unsafeWindow.a = object;
unsafeWindow.b = cloneInto(object, unsafeWindow);
  1. Visit any website, and open the console.

Expected behavior

  • There should be no errors, as in Greasemonkey and Tampermonkey.
  • Executing window.b.key in the console should print "value".

Actual behavior

Uncaught ReferenceError: cloneInto is not defined

Your environment

Chrome 61
Windows 10 14393

Note that in Firefox, accessing window.a.key will throw an error Error: Permission denied to access property "key". This restriction is not present in Chrome.

The shim used by Tampermonkey is function cloneInto(a) { return a; }.

@adbuker
Copy link

adbuker commented Aug 9, 2017

resolved in ADWIN-CR-242

@theseanl
Copy link
Author

I think it makes sense to apply shim for createObjectIn, exportFunction for Chrome too. Tampermonkey includes it and userscript authors may use them without checking user agents.

@adbuker
Copy link

adbuker commented Aug 18, 2017

Yes, indeed, these functions are always together. Resolved in ADWIN-CR-255

@adbuker adbuker changed the title Support cloneInto Support cloneInto, createObjectIn, exportFunction Aug 18, 2017
@adbuker
Copy link

adbuker commented Aug 21, 2017

pull-requests/2

@adbuker adbuker closed this as completed Aug 23, 2017
@vozersky vozersky added beta and removed beta labels Sep 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants