Using the latest version of Chrome, 111.0.5563.147 (Official Build) (64-bit), on up-to-date Windows 11; latest version of UI Vision, V8.3.2.
When I try to refresh the page, this error randomly occurs:
ipcPromise: onAsk timeout 10000 for cmd “PANEL_CALL_PLAY_TAB”, args {“ipcTimeout”:100,“ipcNoLaterThan”:3360391784788,“payload”:{“command”:“DOM_READY”,“args”:{}}}
/* global chrome browser */
// Note: it's an adapter for both chrome and web extension API
// chrome and web extension API have almost the same API signatures
// except that chrome accepts callback while web extension returns promises
//
// The whole idea here is to make sure all callback style API of chrome
// also return promises
//
// Important: You need to specify whatever API you need to use in `UsedAPI` below
(function () {
var adaptChrome = function adaptChrome(obj, chrome) {
var adapt = function adapt(src, ret, obj, fn) {
return (0, _keys2.default)(obj).reduce(function (prev, key) {
var keyParts = key.split('.');
var _keyParts$reduce = keyParts.reduce(function (tuple, subkey) {
var tar = tuple[0];
var src = tuple[1];
tar[subkey] = tar[subkey] || {};
return [tar[subkey], src && src[subkey]];
}, [prev, src]),
_keyParts$reduce2 = (0, _slicedToArray3.default)(_keyParts$reduce, 2),
target = _keyParts$reduce2[0],
source = _keyParts$reduce2[1];
obj[key].forEach(function (method) {
fn(method, source, target);
});
return prev;
}, ret);
};
var promisify = function promisify(method, source, target) {
if (!source) return;
var reg = /The message port closed before a res?ponse was received/;
target[method] = function () {
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return new _promise2.default(function (resolve, reject) {
var callback = function callback(result) {
// Note: The message port closed before a reponse was received.
// Ignore this message
if (chrome.runtime.lastError && !reg.test(chrome.runtime.lastError.message)) {
console.error(chrome.runtime.lastError.message + ', ' + method + ', ' + (0, _stringify2.default)(args));
return reject(chrome.runtime.lastError);
}
resolve(result);
};
source[method].apply(source, args.concat(callback));
});
};