Post

Replies

Boosts

Views

Activity

Reply to Are WebExtension content scripts supported in iframes ?
I'm using this helper: export function getFrameSpec(sender: MessageSender) { 	const tabId = getTab(sender) 	const frameId = notNullOrUndef(sender.frameId, 'sender.frameId') 	const spec = { tabId, frameId } 	return { ...spec, spec } } Which calls this TypeScript not null assertion routine: export function notNullOrUndef<T>( 	t: T | null | undefined, 	name = '<unknown>' ): T | never { 	if (t == null) { 		throw new Error(`Expecting not null for ${name}`) 	} else { 		return t 	} } It's comparing against null using == double equals operator, which in JavaScript would mean the value is either undefined or null. Normally, top level frames should have frameId set to 0
Jul ’20
Reply to Are WebExtension content scripts supported in iframes ?
Timothy, Hi, thanks for your response! MessageSender is the type of object passes as one of the arguments to the chrome.runtime.onMessage handler. See: developer.chrome.com/extensions/runtime#event-onMessage developer.chrome.com/extensions/runtime#type-MessageSender Add https:// for the above links. Unfortunately the editor won't let me create the links.
Jul ’20