File tree 1 file changed +11
-5
lines changed
1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change 60
60
* @param {Object } message
61
61
*/
62
62
'do-script-injection' : function ( message ) {
63
+ const frameId = message . frameId ;
63
64
chrome . windows . getCurrent ( ) . then ( w => {
64
65
chrome . tabs . query ( { active : true , windowId : w . id } ) . then ( tabs => {
66
+ const target = {
67
+ tabId : tabs [ 0 ] . id
68
+ } ;
69
+ // inject the script only into the frame
70
+ // specified in the request from the devTools UI5 panel script;
71
+ // If no frameId specified, the script will be injected into the main frame
72
+ if ( frameId !== undefined ) {
73
+ target . frameIds = [ message . frameId ] ;
74
+ }
65
75
chrome . scripting . executeScript ( {
66
- target : {
67
- // inject the script only into the frame
68
- // specified in the request from the devTools UI5 panel script
69
- tabId : tabs [ 0 ] . id , frameIds : [ message . frameId ]
70
- } ,
76
+ target,
71
77
files : [ message . file ]
72
78
} ) ;
73
79
} ) ;
You can’t perform that action at this time.
0 commit comments