-
Notifications
You must be signed in to change notification settings - Fork 139
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
Not able to set the executionContext using Id of iframe #623
Comments
Sorry for the confusion in the docs, the "ID" referred isn't the frame ID in the DOM, it's the dev tools ID for the execution context. If you look at the JSON result of a test it will have the list of all of the execution contexts with the ID's and origins. I'm pretty sure the execution context's are just sequentially numbered but you'll want to verify the ID in the JSON |
FWIW, for that pen, these are the execution context ID's and origins (at least when tested with desktop): "execution_contexts": [
{
"id": 2,
"origin": "https:\/\/cdpn.io",
"name": ""
},
{
"id": 1,
"origin": "https:\/\/codepen.io",
"name": ""
},
{
"id": 3,
"origin": "https:\/\/codepen.io",
"name": ""
},
{
"id": 5,
"origin": "https:\/\/js.stripe.com",
"name": ""
},
{
"id": 6,
"origin": "https:\/\/m.stripe.network",
"name": ""
}
], |
It looks like the 2 stripe origins are actually different so you could probably use the named origin as well. |
Thanks for your response, I tried setting the execution context using the ID given in the JSON result still, this is not changing the execution context |
There is a type mismatch when setting context by id key. You are comparing string with integer which results in false here: Setting by origin works ok, see here: https://www.webpagetest.org/result/230629_AiDcS7_6GB/ Here are the contexts from JSON:
So for now setting context by id is impossible. |
For a temporary workaround you can use jQuery for switching to another frame (same origin only):
|
Is the fix released yet? It still works by But not yet with |
Doesn't look like it. The prod branch hasn't been updated since the fix landed. |
Use Case:
I would like to change the execution context using Id of the iframe
I referred to the documentation https://docs.webpagetest.org/scripting/#setexecutioncontext for switching the execution context and was able to switch it using origin but was unable to switch the execution context using the ID of the cross-origin iframe.
Script:
Expected Action:
Issue Faced:
The input value is not updating to 'Yugal Vashishth'
This script works fine when I change the execution context using the 'origin' of the iframe but It doesn't work when I use the 'ID' of the iframe.
Note:
I am using ID instead of origin because I have to access two iframes having the same origin, so when I set the execution context using 'origin' it always returns the execution context of the first iframe but I would also like to access the second iframe.
The text was updated successfully, but these errors were encountered: