Force targetTabId to be null if not a number (#678)

This commit is contained in:
toasted-nutbread 2020-07-19 12:26:57 -04:00 committed by GitHub
parent 71b97c2019
commit e12f59f87d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -221,6 +221,7 @@ class CrossFrameAPI {
} }
async invokeTab(targetTabId, targetFrameId, action, params={}) { async invokeTab(targetTabId, targetFrameId, action, params={}) {
if (typeof targetTabId !== 'number') { targetTabId = null; }
const commPort = this._getOrCreateCommPort(targetTabId, targetFrameId); const commPort = this._getOrCreateCommPort(targetTabId, targetFrameId);
return await commPort.invoke(action, params, this._ackTimeout, this._responseTimeout); return await commPort.invoke(action, params, this._ackTimeout, this._responseTimeout);
} }