Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Execute script in specific frame

I can only see how to execute a script in the top level frame or in all frames in a certain tab:

chrome.tabs.executeScript(integer tabId, object details, function callback)

Where if details.allFrames is true then it will be executed in each subframe, but if it is false, it will only execute in the top level frame. How can I provide a frameId to execute the script in?

like image 508
Daniel Avatar asked Jun 26 '12 16:06

Daniel


1 Answers

As far as I know, you can't. Instead, set allFrames: true and write javascript in the content script to detect if it is the correct frame, and return without doing anything if it is not the correct frame.

like image 92
Siddhi Avatar answered Sep 20 '22 06:09

Siddhi