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

Core: Fire iframe script in its context, add doc param in globalEval #4601

Merged
merged 1 commit into from
Feb 10, 2020

Conversation

mgol
Copy link
Member

@mgol mgol commented Feb 3, 2020

Summary

  1. Support passing custom document to jQuery.globalEval; the script will be
    invoked in the context of this document.
  2. Fire external scripts appended to iframe contents in that iframe context;
    this was already supported & tested for inline scripts but not for external
    ones.

Fixes gh-4518

Checklist

@mgol
Copy link
Member Author

mgol commented Feb 3, 2020

+5 bytes

@mgol mgol force-pushed the external-script-iframe-context branch from 4a62637 to 5d9974b Compare February 3, 2020 16:59
src/core.js Show resolved Hide resolved
…in globalEval

1. Support passing custom document to jQuery.globalEval; the script will be
   invoked in the context of this document.
2. Fire external scripts appended to iframe contents in that iframe context;
   this was already supported & tested for inline scripts but not for external
   ones.

Fixes jquerygh-4518
@mgol mgol force-pushed the external-script-iframe-context branch from 5d9974b to 90f9135 Compare February 4, 2020 16:47
@mgol mgol self-assigned this Feb 5, 2020
@mgol mgol removed the Needs review label Feb 10, 2020
@mgol mgol changed the title Core:Manipulation: Fire iframe scripts in its context, add doc param in globalEval Core: Fire iframe script in its context, add doc param in globalEval Feb 10, 2020
@mgol mgol merged commit 4592595 into jquery:master Feb 10, 2020
@mgol mgol deleted the external-script-iframe-context branch February 10, 2020 18:17
mgol added a commit that referenced this pull request Feb 10, 2020
1. Support passing custom document to jQuery.globalEval; the script will be
   invoked in the context of this document.
2. Fire external scripts appended to iframe contents in that iframe context;
   this was already supported & tested for inline scripts but not for external
   ones.

Fixes gh-4518
Closes gh-4601

(cherry picked from commit 4592595)
@mgol
Copy link
Member Author

mgol commented Feb 10, 2020

Landed on master in 4592595 and on 3.x-stable in 3dedc3f.

mgol added a commit to mgol/api.jquery.com that referenced this pull request Jul 18, 2020
Since jQuery 3.5.0, jQuery.globalEval accepts an optional third parameter
accepting a document in which context the code will be evaluated.

This commit also adds the Document type and links it to one of the jQuery
signatures; so far it was using `type="document"` which linked to a non-existent
types section.

Ref jquery/jquery#4601
mgol added a commit to jquery/api.jquery.com that referenced this pull request Jul 20, 2020
Since jQuery 3.5.0, jQuery.globalEval accepts an optional third parameter
accepting a document in which context the code will be evaluated.

This commit also adds the Document type and links it to one of the jQuery
signatures; so far it was using `type="document"` which linked to a non-existent
types section.

Closes gh-1168
Ref jquery/jquery#4601
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

.append() script string to iframe causes script execution in top window
2 participants