Post

Replies

Boosts

Views

Activity

Are WebExtension content scripts supported in iframes ?
An extension I maintain, which works on Firefox/Chromium Edge/Chrome etc declares a content script to be run in all iframes. Does safari support content scripts in iframes? It seems the MessageSender object is missing the frameId member. It is thus impossible to tell what frame a content script is running in. Manifest Excerpt 	"content_scripts": [ 		{ 			"matches": [ 				"https://*/*", 				"http://*/*" 			], 			"js": [ 				"content.js" 			], 			"match_about_blank": false, 			"all_frames": true, 			"run_at": "document_start" 		} 	], MessageSender interface definition /** An object containing information about the script context that sent a message or request. @since Chrome 26. / export interface MessageSender { 		/** The ID of the extension or app that opened the connection, if any. */ 		id?: string; 		/** The tabs.Tab which opened the connection, if any. This property will only be present when the connection was opened from a tab (including content scripts), and only if the receiver is an extension, not an app. */ 		tab?: chrome.tabs.Tab; 		/** 		 * The frame that opened the connection. 0 for top-level frames, positive for child frames. This will only be set when tab is set. 		 * @since Chrome 41. 		 */ 		frameId?: number;
15
0
2.3k
Jul ’20