@inboxsdk/core 2.2.18 → 2.2.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/inboxsdk.js +170 -339
- package/inboxsdk.js.map +1 -1
- package/package.json +1 -1
- package/pageWorld.js +0 -265
- package/pageWorld.js.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver.d.ts +3 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver.d.ts.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/selectors.d.ts +33 -0
- package/src/platform-implementation-js/dom-driver/gmail/selectors.d.ts.map +1 -0
- package/src/platform-implementation-js/lib/dom/mergeSelectorOverrides.d.ts +22 -0
- package/src/platform-implementation-js/lib/dom/mergeSelectorOverrides.d.ts.map +1 -0
- package/src/platform-implementation-js/lib/dom/selectorRegistry.d.ts +28 -0
- package/src/platform-implementation-js/lib/dom/selectorRegistry.d.ts.map +1 -0
- package/src/platform-implementation-js/lib/logger.d.ts.map +1 -1
- package/src/platform-implementation-js/platform-implementation.d.ts +6 -0
- package/src/platform-implementation-js/platform-implementation.d.ts.map +1 -1
package/inboxsdk.js
CHANGED
|
@@ -371,7 +371,7 @@ function isNotNil(value) {
|
|
|
371
371
|
|
|
372
372
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- SDK_VERSION is injected by webpack
|
|
373
373
|
///@ts-ignore
|
|
374
|
-
const BUILD_VERSION = "2.2.
|
|
374
|
+
const BUILD_VERSION = "2.2.19-1786580061685-3573e62ec8d2327b";
|
|
375
375
|
if (false) {}
|
|
376
376
|
|
|
377
377
|
/***/ }),
|
|
@@ -2711,7 +2711,7 @@ options.insert = htmlElement => {
|
|
|
2711
2711
|
htmlElement.setAttribute('data-inboxsdk-version',
|
|
2712
2712
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- this is injected by webpack
|
|
2713
2713
|
///@ts-ignore
|
|
2714
|
-
"2.2.
|
|
2714
|
+
"2.2.19-1786580061685-3573e62ec8d2327b");
|
|
2715
2715
|
document.head.append(htmlElement);
|
|
2716
2716
|
};
|
|
2717
2717
|
options.domAPI = (styleDomAPI_default());
|
|
@@ -6349,8 +6349,7 @@ class GmailComposeView {
|
|
|
6349
6349
|
}
|
|
6350
6350
|
}
|
|
6351
6351
|
setTitleBarColor(color) {
|
|
6352
|
-
|
|
6353
|
-
const buttonParent = this.#element.querySelector('.nH.Hy.aXJ table.cf.Ht td.Hm') || this.#element.querySelector('.nH.Hy.aXJ table.cf td.Hm');
|
|
6352
|
+
const buttonParent = this.#driver.selectors.querySelectorByKey(this.#element, 'composeView.titleBarTd');
|
|
6354
6353
|
if (!buttonParent) {
|
|
6355
6354
|
// cosmetic; log and skip rather than throw
|
|
6356
6355
|
this.#driver.getLogger().error(new Error('setTitleBarColor: could not find compose title bar'));
|
|
@@ -6372,9 +6371,7 @@ class GmailComposeView {
|
|
|
6372
6371
|
if (this.isInlineReplyForm()) {
|
|
6373
6372
|
throw new Error('setTitleBarText() is not supported on inline compose views');
|
|
6374
6373
|
}
|
|
6375
|
-
|
|
6376
|
-
// Gmail A/B-renames the `Ht` token; fall back to a structural selector.
|
|
6377
|
-
const titleBarTable = this.#element.querySelector('.nH.Hy.aXJ table.cf.Ht') || this.#element.querySelector('.nH.Hy.aXJ table.cf');
|
|
6374
|
+
const titleBarTable = this.#driver.selectors.querySelectorByKey(this.#element, 'composeView.titleBarTable');
|
|
6378
6375
|
if (!titleBarTable) {
|
|
6379
6376
|
// cosmetic; log and skip rather than throw
|
|
6380
6377
|
this.#driver.getLogger().error(new Error('setTitleBarText: could not find compose title bar'));
|
|
@@ -10380,7 +10377,7 @@ options.insert = htmlElement => {
|
|
|
10380
10377
|
htmlElement.setAttribute('data-inboxsdk-version',
|
|
10381
10378
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- this is injected by webpack
|
|
10382
10379
|
///@ts-ignore
|
|
10383
|
-
"2.2.
|
|
10380
|
+
"2.2.19-1786580061685-3573e62ec8d2327b");
|
|
10384
10381
|
document.head.append(htmlElement);
|
|
10385
10382
|
};
|
|
10386
10383
|
options.domAPI = (styleDomAPI_default());
|
|
@@ -10887,8 +10884,6 @@ class PersistentQueue {
|
|
|
10887
10884
|
}
|
|
10888
10885
|
// EXTERNAL MODULE: ./src/platform-implementation-js/lib/dom/make-mutation-observer-stream.ts
|
|
10889
10886
|
var make_mutation_observer_stream = __webpack_require__(5938);
|
|
10890
|
-
// EXTERNAL MODULE: ./node_modules/ext-corb-workaround/dist/src/index.js
|
|
10891
|
-
var src = __webpack_require__(9482);
|
|
10892
10887
|
// EXTERNAL MODULE: ./src/platform-implementation-js/lib/isStreakAppId.ts
|
|
10893
10888
|
var isStreakAppId = __webpack_require__(8579);
|
|
10894
10889
|
;// CONCATENATED MODULE: ./src/platform-implementation-js/lib/logger.ts
|
|
@@ -10901,7 +10896,6 @@ var isStreakAppId = __webpack_require__(8579);
|
|
|
10901
10896
|
|
|
10902
10897
|
|
|
10903
10898
|
|
|
10904
|
-
|
|
10905
10899
|
// Yeah, this module is a singleton with some shared state. This is just for
|
|
10906
10900
|
// logging convenience. Other modules should avoid doing this!
|
|
10907
10901
|
const _extensionAppIds = [];
|
|
@@ -11276,9 +11270,7 @@ async function retrieveNewEventsAccessToken() {
|
|
|
11276
11270
|
const {
|
|
11277
11271
|
text
|
|
11278
11272
|
} = await (0,ajax/* default */.A)({
|
|
11279
|
-
url: 'https://api.inboxsdk.com/api/v2/events/oauth'
|
|
11280
|
-
// Work around CORB for extensions that have permissions to inboxsdk.com
|
|
11281
|
-
XMLHttpRequest: (0,src/* getXMLHttpRequest */.np)()
|
|
11273
|
+
url: 'https://api.inboxsdk.com/api/v2/events/oauth'
|
|
11282
11274
|
});
|
|
11283
11275
|
const accessToken = JSON.parse(text);
|
|
11284
11276
|
if (isTimestampExpired(accessToken.expirationDate)) {
|
|
@@ -11524,7 +11516,7 @@ if (!globalThis.__InboxSDKImpLoader) {
|
|
|
11524
11516
|
await onready;
|
|
11525
11517
|
const {
|
|
11526
11518
|
makePlatformImplementation
|
|
11527
|
-
} = await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__,
|
|
11519
|
+
} = await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 7064));
|
|
11528
11520
|
return makePlatformImplementation(appId, opts, {
|
|
11529
11521
|
piMainStarted,
|
|
11530
11522
|
piLoadStarted,
|
|
@@ -11673,7 +11665,7 @@ class Keyboard {
|
|
|
11673
11665
|
|
|
11674
11666
|
/***/ }),
|
|
11675
11667
|
|
|
11676
|
-
/***/
|
|
11668
|
+
/***/ 7064:
|
|
11677
11669
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
11678
11670
|
|
|
11679
11671
|
"use strict";
|
|
@@ -15142,7 +15134,7 @@ options.insert = htmlElement => {
|
|
|
15142
15134
|
htmlElement.setAttribute('data-inboxsdk-version',
|
|
15143
15135
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- this is injected by webpack
|
|
15144
15136
|
///@ts-ignore
|
|
15145
|
-
"2.2.
|
|
15137
|
+
"2.2.19-1786580061685-3573e62ec8d2327b");
|
|
15146
15138
|
document.head.append(htmlElement);
|
|
15147
15139
|
};
|
|
15148
15140
|
options.domAPI = (styleDomAPI_default());
|
|
@@ -19908,7 +19900,7 @@ mole_view_module_options.insert = htmlElement => {
|
|
|
19908
19900
|
htmlElement.setAttribute('data-inboxsdk-version',
|
|
19909
19901
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- this is injected by webpack
|
|
19910
19902
|
///@ts-ignore
|
|
19911
|
-
"2.2.
|
|
19903
|
+
"2.2.19-1786580061685-3573e62ec8d2327b");
|
|
19912
19904
|
document.head.append(htmlElement);
|
|
19913
19905
|
};
|
|
19914
19906
|
mole_view_module_options.domAPI = (styleDomAPI_default());
|
|
@@ -24240,6 +24232,157 @@ function parseListPeopleByKnownIdResponse(data) {
|
|
|
24240
24232
|
}
|
|
24241
24233
|
return response;
|
|
24242
24234
|
}
|
|
24235
|
+
;// CONCATENATED MODULE: ./src/platform-implementation-js/dom-driver/gmail/selectors.ts
|
|
24236
|
+
/**
|
|
24237
|
+
* Bundled Gmail selector registry.
|
|
24238
|
+
*
|
|
24239
|
+
* Each key maps to an ORDERED list of candidates, tried one at a time until one
|
|
24240
|
+
* matches. An extension can supply overrides to this registry, which are PREPENDED
|
|
24241
|
+
* to the bundled chain.
|
|
24242
|
+
*
|
|
24243
|
+
* Selectors must be ordered by preference (which selector must be tried first),
|
|
24244
|
+
* not in chronological order.
|
|
24245
|
+
*
|
|
24246
|
+
* Never join a chain into one comma-separated selector: `querySelector('a, b')` picks
|
|
24247
|
+
* the first match in document order, which ignores this ranking.
|
|
24248
|
+
*/
|
|
24249
|
+
const GMAIL_SELECTORS = {
|
|
24250
|
+
/**
|
|
24251
|
+
* The compose title-bar table, resolved against the compose root.
|
|
24252
|
+
*
|
|
24253
|
+
* The `Ht`-less rung matches a superset of the `Ht` one, so it must stay BELOW it:
|
|
24254
|
+
* above, it would win always and the specific rung would never run.
|
|
24255
|
+
*/
|
|
24256
|
+
'composeView.titleBarTable': ['.nH.Hy.aXJ table.cf.Ht', '.nH.Hy.aXJ table.cf'],
|
|
24257
|
+
/**
|
|
24258
|
+
* The title-bar cell holding the compose window buttons — inside the table above,
|
|
24259
|
+
* but resolved against the same compose root.
|
|
24260
|
+
*/
|
|
24261
|
+
'composeView.titleBarTd': ['.nH.Hy.aXJ table.cf.Ht td.Hm', '.nH.Hy.aXJ table.cf td.Hm']
|
|
24262
|
+
};
|
|
24263
|
+
|
|
24264
|
+
/** Resolved candidates for every key. The merge builds new lists. */
|
|
24265
|
+
|
|
24266
|
+
/** Shape of the `selectors` object in a remote config. */
|
|
24267
|
+
// EXTERNAL MODULE: ./node_modules/lodash/uniq.js
|
|
24268
|
+
var uniq = __webpack_require__(1285);
|
|
24269
|
+
var uniq_default = /*#__PURE__*/__webpack_require__.n(uniq);
|
|
24270
|
+
;// CONCATENATED MODULE: ./src/platform-implementation-js/lib/dom/mergeSelectorOverrides.ts
|
|
24271
|
+
|
|
24272
|
+
|
|
24273
|
+
/**
|
|
24274
|
+
* Unmounted fragment, used to validate CSS selectors.
|
|
24275
|
+
*/
|
|
24276
|
+
let validationRoot;
|
|
24277
|
+
|
|
24278
|
+
/**
|
|
24279
|
+
* Check whether the given selector is valid.
|
|
24280
|
+
*/
|
|
24281
|
+
function isValidSelector(selector) {
|
|
24282
|
+
if (!validationRoot) {
|
|
24283
|
+
validationRoot = document.createDocumentFragment();
|
|
24284
|
+
}
|
|
24285
|
+
try {
|
|
24286
|
+
validationRoot.querySelector(selector);
|
|
24287
|
+
return true;
|
|
24288
|
+
} catch {
|
|
24289
|
+
return false;
|
|
24290
|
+
}
|
|
24291
|
+
}
|
|
24292
|
+
|
|
24293
|
+
/** Called for each dropped candidate: silent to the user, loud to the operator. */
|
|
24294
|
+
|
|
24295
|
+
/**
|
|
24296
|
+
* Merges two selector registry objects (defaults and overrides),
|
|
24297
|
+
* filtering out invalid selectors from the overrides. If found,
|
|
24298
|
+
* it prepends the valid overrides to the defaults.
|
|
24299
|
+
*
|
|
24300
|
+
* @example
|
|
24301
|
+
* ```ts
|
|
24302
|
+
* mergeSelectorOverrides(
|
|
24303
|
+
* { 'composeView.someKey': ['.foo'] },
|
|
24304
|
+
* { 'composeView.someKey': ['.bar', 'invalid selector'] }
|
|
24305
|
+
* );
|
|
24306
|
+
* // { 'composeView.someKey': ['.bar', '.foo'] }
|
|
24307
|
+
* ```
|
|
24308
|
+
*/
|
|
24309
|
+
function mergeSelectorOverrides(defaults, overrides, onInvalid) {
|
|
24310
|
+
const merged = {};
|
|
24311
|
+
for (const key of Object.keys(defaults)) {
|
|
24312
|
+
const extra = (overrides[key] ?? []).filter(selector => {
|
|
24313
|
+
if (isValidSelector(selector)) {
|
|
24314
|
+
return true;
|
|
24315
|
+
}
|
|
24316
|
+
onInvalid?.(key, selector);
|
|
24317
|
+
return false;
|
|
24318
|
+
});
|
|
24319
|
+
merged[key] = uniq_default()([...extra, ...defaults[key]]);
|
|
24320
|
+
}
|
|
24321
|
+
return merged;
|
|
24322
|
+
}
|
|
24323
|
+
;// CONCATENATED MODULE: ./src/platform-implementation-js/lib/dom/selectorRegistry.ts
|
|
24324
|
+
|
|
24325
|
+
|
|
24326
|
+
|
|
24327
|
+
/**
|
|
24328
|
+
* Install overrides into the bundled defaults, filtering out invalid
|
|
24329
|
+
* selectors. If there are any errors merging the overrides, we fallback
|
|
24330
|
+
* to the SDK bundled defaults.
|
|
24331
|
+
*/
|
|
24332
|
+
function mergeOrFallBack(_ref) {
|
|
24333
|
+
let {
|
|
24334
|
+
overrides,
|
|
24335
|
+
onInvalidSelector
|
|
24336
|
+
} = _ref;
|
|
24337
|
+
if (!overrides) {
|
|
24338
|
+
return GMAIL_SELECTORS;
|
|
24339
|
+
}
|
|
24340
|
+
try {
|
|
24341
|
+
return mergeSelectorOverrides(GMAIL_SELECTORS, overrides, onInvalidSelector);
|
|
24342
|
+
} catch {
|
|
24343
|
+
return GMAIL_SELECTORS;
|
|
24344
|
+
}
|
|
24345
|
+
}
|
|
24346
|
+
|
|
24347
|
+
/**
|
|
24348
|
+
* Resolves named keys to elements, trying each of the key's candidates in
|
|
24349
|
+
* order. Owned by the GmailDriver, so each InboxSDK instance resolves against
|
|
24350
|
+
* its own candidates and a registry is never read before it is built.
|
|
24351
|
+
*/
|
|
24352
|
+
class SelectorRegistry {
|
|
24353
|
+
#candidates;
|
|
24354
|
+
constructor() {
|
|
24355
|
+
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
24356
|
+
this.#candidates = mergeOrFallBack(options);
|
|
24357
|
+
}
|
|
24358
|
+
|
|
24359
|
+
/**
|
|
24360
|
+
* Resolve a registry key against `el`, returning null on a miss. Use this
|
|
24361
|
+
* method if you want to degrade functionality when a selector is missing,
|
|
24362
|
+
* instead of throwing an error.
|
|
24363
|
+
*/
|
|
24364
|
+
querySelectorByKey(el, key) {
|
|
24365
|
+
// Try each candidate in order, returning the first match (null otherwise).
|
|
24366
|
+
for (const candidateSelector of this.#candidates[key]) {
|
|
24367
|
+
const found = el.querySelector(candidateSelector);
|
|
24368
|
+
if (found) {
|
|
24369
|
+
return found;
|
|
24370
|
+
}
|
|
24371
|
+
}
|
|
24372
|
+
return null;
|
|
24373
|
+
}
|
|
24374
|
+
|
|
24375
|
+
/**
|
|
24376
|
+
* Resolve a registry key against `el`, but throws if no candidate matches.
|
|
24377
|
+
*/
|
|
24378
|
+
querySelectorByKeyOrFail(el, key) {
|
|
24379
|
+
const found = this.querySelectorByKey(el, key);
|
|
24380
|
+
if (!found) {
|
|
24381
|
+
throw new querySelectorOrFail/* SelectorError */.a(`${key} (${this.#candidates[key].join(' || ')})`);
|
|
24382
|
+
}
|
|
24383
|
+
return found;
|
|
24384
|
+
}
|
|
24385
|
+
}
|
|
24243
24386
|
;// CONCATENATED MODULE: ./src/platform-implementation-js/dom-driver/gmail/gmail-driver.ts
|
|
24244
24387
|
|
|
24245
24388
|
|
|
@@ -24299,6 +24442,7 @@ function parseListPeopleByKnownIdResponse(data) {
|
|
|
24299
24442
|
|
|
24300
24443
|
|
|
24301
24444
|
|
|
24445
|
+
|
|
24302
24446
|
|
|
24303
24447
|
|
|
24304
24448
|
/**
|
|
@@ -24315,6 +24459,8 @@ class GmailDriver {
|
|
|
24315
24459
|
#logger;
|
|
24316
24460
|
#opts;
|
|
24317
24461
|
#envData;
|
|
24462
|
+
/** Resolves selector keys against the bundled defaults plus any overrides. */
|
|
24463
|
+
|
|
24318
24464
|
#customRouteIDs = new Set();
|
|
24319
24465
|
#customListRouteIDs = new Map();
|
|
24320
24466
|
#customListSearchStringsToRouteIds = new Map();
|
|
@@ -24350,6 +24496,10 @@ class GmailDriver {
|
|
|
24350
24496
|
this.#logger = logger;
|
|
24351
24497
|
this.#opts = opts;
|
|
24352
24498
|
this.#envData = envData;
|
|
24499
|
+
this.selectors = new SelectorRegistry({
|
|
24500
|
+
overrides: opts.selectorOverrides,
|
|
24501
|
+
onInvalidSelector: opts.onInvalidSelector
|
|
24502
|
+
});
|
|
24353
24503
|
this.#page = (0,makePageParserTree/* default */.A)(this, document);
|
|
24354
24504
|
this.#stopper.onValue(() => this.#page.dump());
|
|
24355
24505
|
|
|
@@ -32309,7 +32459,7 @@ module.exports = function (element, useCapture) {
|
|
|
32309
32459
|
return self;
|
|
32310
32460
|
};
|
|
32311
32461
|
|
|
32312
|
-
module.exports.prototype.bind = __webpack_require__(
|
|
32462
|
+
module.exports.prototype.bind = __webpack_require__(2449);
|
|
32313
32463
|
module.exports.prototype.bindMultiple = __webpack_require__(9829);
|
|
32314
32464
|
module.exports.prototype.trigger = __webpack_require__(9240);
|
|
32315
32465
|
module.exports.prototype.reset = __webpack_require__(8967);
|
|
@@ -32366,7 +32516,7 @@ module.exports = function (useCapture) {
|
|
|
32366
32516
|
|
|
32367
32517
|
/***/ }),
|
|
32368
32518
|
|
|
32369
|
-
/***/
|
|
32519
|
+
/***/ 2449:
|
|
32370
32520
|
/***/ ((module) => {
|
|
32371
32521
|
|
|
32372
32522
|
"use strict";
|
|
@@ -39310,325 +39460,6 @@ function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
|
|
|
39310
39460
|
}
|
|
39311
39461
|
|
|
39312
39462
|
|
|
39313
|
-
/***/ }),
|
|
39314
|
-
|
|
39315
|
-
/***/ 9482:
|
|
39316
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
39317
|
-
|
|
39318
|
-
"use strict";
|
|
39319
|
-
var __webpack_unused_export__;
|
|
39320
|
-
|
|
39321
|
-
|
|
39322
|
-
var _interopRequireDefault = __webpack_require__(1654);
|
|
39323
|
-
|
|
39324
|
-
__webpack_unused_export__ = ({
|
|
39325
|
-
value: true
|
|
39326
|
-
});
|
|
39327
|
-
__webpack_unused_export__ = exports.np = void 0;
|
|
39328
|
-
|
|
39329
|
-
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(9131));
|
|
39330
|
-
|
|
39331
|
-
var _createClass2 = _interopRequireDefault(__webpack_require__(8463));
|
|
39332
|
-
|
|
39333
|
-
var _defineProperty2 = _interopRequireDefault(__webpack_require__(5985));
|
|
39334
|
-
|
|
39335
|
-
var _slicedToArray2 = _interopRequireDefault(__webpack_require__(6583));
|
|
39336
|
-
|
|
39337
|
-
var _once = _interopRequireDefault(__webpack_require__(8921));
|
|
39338
|
-
|
|
39339
|
-
var _moduleId = __webpack_require__(917);
|
|
39340
|
-
|
|
39341
|
-
var _transferrables = _interopRequireDefault(__webpack_require__(5440));
|
|
39342
|
-
|
|
39343
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
39344
|
-
|
|
39345
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
39346
|
-
|
|
39347
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
39348
|
-
|
|
39349
|
-
var getXMLHttpRequest = (0, _once["default"])(function () {
|
|
39350
|
-
// Make sure we communicate to the injected script that's paired with
|
|
39351
|
-
// this instance of this module. This is necessary in case there are
|
|
39352
|
-
// multiple javascript bundles with this package executing at once in the
|
|
39353
|
-
// same page.
|
|
39354
|
-
var instancesById = {};
|
|
39355
|
-
var channel = new MessageChannel();
|
|
39356
|
-
var port = channel.port1;
|
|
39357
|
-
port.addEventListener('message', function (event) {
|
|
39358
|
-
var _event$data = event.data,
|
|
39359
|
-
id = _event$data.id,
|
|
39360
|
-
type = _event$data.type;
|
|
39361
|
-
var xhr = instancesById[id];
|
|
39362
|
-
|
|
39363
|
-
switch (type) {
|
|
39364
|
-
case 'COMPLETE':
|
|
39365
|
-
{
|
|
39366
|
-
var _event$data2 = event.data,
|
|
39367
|
-
headers = _event$data2.headers,
|
|
39368
|
-
readyState = _event$data2.readyState,
|
|
39369
|
-
status = _event$data2.status,
|
|
39370
|
-
statusText = _event$data2.statusText,
|
|
39371
|
-
response = _event$data2.response,
|
|
39372
|
-
responseText = _event$data2.responseText,
|
|
39373
|
-
responseURL = _event$data2.responseURL;
|
|
39374
|
-
var headersObj = {};
|
|
39375
|
-
headers.split('\r\n').forEach(function (line) {
|
|
39376
|
-
var _line$split = line.split(':'),
|
|
39377
|
-
_line$split2 = (0, _slicedToArray2["default"])(_line$split, 2),
|
|
39378
|
-
name = _line$split2[0],
|
|
39379
|
-
value = _line$split2[1];
|
|
39380
|
-
|
|
39381
|
-
if (name && value) {
|
|
39382
|
-
headersObj[name.toLowerCase().trim()] = value.trim();
|
|
39383
|
-
}
|
|
39384
|
-
});
|
|
39385
|
-
xhr._headers = headers;
|
|
39386
|
-
xhr._headersObj = headersObj;
|
|
39387
|
-
xhr.status = status;
|
|
39388
|
-
xhr.statusText = statusText;
|
|
39389
|
-
xhr.readyState = readyState;
|
|
39390
|
-
xhr.response = response;
|
|
39391
|
-
xhr.responseText = responseText;
|
|
39392
|
-
xhr.responseURL = responseURL;
|
|
39393
|
-
delete instancesById[id];
|
|
39394
|
-
|
|
39395
|
-
var _loop = function _loop() {
|
|
39396
|
-
var event = _arr[_i];
|
|
39397
|
-
var eventObj = {
|
|
39398
|
-
name: event,
|
|
39399
|
-
target: xhr
|
|
39400
|
-
};
|
|
39401
|
-
var handlers = Object.prototype.hasOwnProperty.call(xhr._eventListeners, event) ? xhr._eventListeners[event] : [];
|
|
39402
|
-
handlers.forEach(function (handler) {
|
|
39403
|
-
return handler(eventObj);
|
|
39404
|
-
});
|
|
39405
|
-
|
|
39406
|
-
if (xhr['on' + event]) {
|
|
39407
|
-
xhr['on' + event](eventObj);
|
|
39408
|
-
}
|
|
39409
|
-
};
|
|
39410
|
-
|
|
39411
|
-
for (var _i = 0, _arr = ['load', 'loadend', 'readystatechange']; _i < _arr.length; _i++) {
|
|
39412
|
-
_loop();
|
|
39413
|
-
}
|
|
39414
|
-
|
|
39415
|
-
break;
|
|
39416
|
-
}
|
|
39417
|
-
|
|
39418
|
-
default:
|
|
39419
|
-
{
|
|
39420
|
-
// eslint-disable-next-line no-console
|
|
39421
|
-
console.error('ext-corb-workaround: Unknown event in content script:', event);
|
|
39422
|
-
}
|
|
39423
|
-
}
|
|
39424
|
-
});
|
|
39425
|
-
port.addEventListener('messageerror', function (event) {
|
|
39426
|
-
// eslint-disable-next-line no-console
|
|
39427
|
-
console.error('ext-corb-workaround: Unknown error in content script:', event);
|
|
39428
|
-
});
|
|
39429
|
-
port.start();
|
|
39430
|
-
window.postMessage({
|
|
39431
|
-
type: 'ext-corb-workaround_port',
|
|
39432
|
-
moduleId: _moduleId.moduleId,
|
|
39433
|
-
port: channel.port2
|
|
39434
|
-
}, document.location.origin, [channel.port2]);
|
|
39435
|
-
var nextFreeId = 0;
|
|
39436
|
-
|
|
39437
|
-
var CORBWorkaroundXMLHttpRequest = /*#__PURE__*/function () {
|
|
39438
|
-
function CORBWorkaroundXMLHttpRequest() {
|
|
39439
|
-
var _this = this;
|
|
39440
|
-
|
|
39441
|
-
(0, _classCallCheck2["default"])(this, CORBWorkaroundXMLHttpRequest);
|
|
39442
|
-
(0, _defineProperty2["default"])(this, "UNSENT", 0);
|
|
39443
|
-
(0, _defineProperty2["default"])(this, "OPENED", 1);
|
|
39444
|
-
(0, _defineProperty2["default"])(this, "HEADERS_RECEIVED", 2);
|
|
39445
|
-
(0, _defineProperty2["default"])(this, "LOADING", 3);
|
|
39446
|
-
(0, _defineProperty2["default"])(this, "DONE", 4);
|
|
39447
|
-
(0, _defineProperty2["default"])(this, "_id", nextFreeId++);
|
|
39448
|
-
(0, _defineProperty2["default"])(this, "_eventListeners", {});
|
|
39449
|
-
(0, _defineProperty2["default"])(this, "_headersObj", {});
|
|
39450
|
-
(0, _defineProperty2["default"])(this, "status", 0);
|
|
39451
|
-
(0, _defineProperty2["default"])(this, "statusText", '');
|
|
39452
|
-
(0, _defineProperty2["default"])(this, "readyState", 0);
|
|
39453
|
-
(0, _defineProperty2["default"])(this, "response", '');
|
|
39454
|
-
(0, _defineProperty2["default"])(this, "responseText", '');
|
|
39455
|
-
(0, _defineProperty2["default"])(this, "responseURL", '');
|
|
39456
|
-
(0, _defineProperty2["default"])(this, "_headers", '');
|
|
39457
|
-
(0, _defineProperty2["default"])(this, "responseType", void 0);
|
|
39458
|
-
(0, _defineProperty2["default"])(this, "withCredentials", void 0);
|
|
39459
|
-
(0, _defineProperty2["default"])(this, "setRequestHeader", void 0);
|
|
39460
|
-
(0, _defineProperty2["default"])(this, "open", void 0);
|
|
39461
|
-
(0, _defineProperty2["default"])(this, "send", void 0);
|
|
39462
|
-
(0, _defineProperty2["default"])(this, "abort", void 0);
|
|
39463
|
-
var id = this._id;
|
|
39464
|
-
instancesById[id] = this;
|
|
39465
|
-
port.postMessage({
|
|
39466
|
-
type: 'NEW_XHR',
|
|
39467
|
-
id: id
|
|
39468
|
-
});
|
|
39469
|
-
|
|
39470
|
-
var _iterator = _createForOfIteratorHelper(['responseType', 'withCredentials']),
|
|
39471
|
-
_step;
|
|
39472
|
-
|
|
39473
|
-
try {
|
|
39474
|
-
var _loop2 = function _loop2() {
|
|
39475
|
-
var prop = _step.value;
|
|
39476
|
-
var value = undefined;
|
|
39477
|
-
Object.defineProperty(_this, prop, {
|
|
39478
|
-
get: function get() {
|
|
39479
|
-
return value;
|
|
39480
|
-
},
|
|
39481
|
-
set: function set(newValue) {
|
|
39482
|
-
value = newValue;
|
|
39483
|
-
port.postMessage({
|
|
39484
|
-
type: 'SET',
|
|
39485
|
-
id: id,
|
|
39486
|
-
prop: prop,
|
|
39487
|
-
value: newValue
|
|
39488
|
-
});
|
|
39489
|
-
}
|
|
39490
|
-
});
|
|
39491
|
-
};
|
|
39492
|
-
|
|
39493
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
39494
|
-
_loop2();
|
|
39495
|
-
}
|
|
39496
|
-
} catch (err) {
|
|
39497
|
-
_iterator.e(err);
|
|
39498
|
-
} finally {
|
|
39499
|
-
_iterator.f();
|
|
39500
|
-
}
|
|
39501
|
-
|
|
39502
|
-
var _iterator2 = _createForOfIteratorHelper(['setRequestHeader', 'open', 'send', 'abort']),
|
|
39503
|
-
_step2;
|
|
39504
|
-
|
|
39505
|
-
try {
|
|
39506
|
-
var _loop3 = function _loop3() {
|
|
39507
|
-
var method = _step2.value;
|
|
39508
|
-
|
|
39509
|
-
_this[method] = function () {
|
|
39510
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
39511
|
-
args[_key] = arguments[_key];
|
|
39512
|
-
}
|
|
39513
|
-
|
|
39514
|
-
port.postMessage({
|
|
39515
|
-
type: 'CALL',
|
|
39516
|
-
id: id,
|
|
39517
|
-
method: method,
|
|
39518
|
-
args: args
|
|
39519
|
-
}, (0, _transferrables["default"])(args));
|
|
39520
|
-
};
|
|
39521
|
-
};
|
|
39522
|
-
|
|
39523
|
-
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
39524
|
-
_loop3();
|
|
39525
|
-
}
|
|
39526
|
-
} catch (err) {
|
|
39527
|
-
_iterator2.e(err);
|
|
39528
|
-
} finally {
|
|
39529
|
-
_iterator2.f();
|
|
39530
|
-
}
|
|
39531
|
-
}
|
|
39532
|
-
|
|
39533
|
-
(0, _createClass2["default"])(CORBWorkaroundXMLHttpRequest, [{
|
|
39534
|
-
key: "getAllResponseHeaders",
|
|
39535
|
-
value: function getAllResponseHeaders() {
|
|
39536
|
-
return this._headers;
|
|
39537
|
-
}
|
|
39538
|
-
}, {
|
|
39539
|
-
key: "getResponseHeader",
|
|
39540
|
-
value: function getResponseHeader(header) {
|
|
39541
|
-
header = header.toLowerCase();
|
|
39542
|
-
|
|
39543
|
-
if (Object.prototype.hasOwnProperty.call(this._headersObj, header)) {
|
|
39544
|
-
return this._headersObj[header];
|
|
39545
|
-
}
|
|
39546
|
-
}
|
|
39547
|
-
}, {
|
|
39548
|
-
key: "addEventListener",
|
|
39549
|
-
value: function addEventListener(event, handler) {
|
|
39550
|
-
if (!Object.prototype.hasOwnProperty.call(this._eventListeners, event)) {
|
|
39551
|
-
this._eventListeners[event] = [];
|
|
39552
|
-
}
|
|
39553
|
-
|
|
39554
|
-
this._eventListeners[event].push(handler);
|
|
39555
|
-
}
|
|
39556
|
-
}, {
|
|
39557
|
-
key: "removeEventListener",
|
|
39558
|
-
value: function removeEventListener(event, handler) {
|
|
39559
|
-
if (Object.prototype.hasOwnProperty.call(this._eventListeners, event)) {
|
|
39560
|
-
this._eventListeners[event] = this._eventListeners[event].filter(function (_handler) {
|
|
39561
|
-
return handler !== _handler;
|
|
39562
|
-
});
|
|
39563
|
-
}
|
|
39564
|
-
}
|
|
39565
|
-
}]);
|
|
39566
|
-
return CORBWorkaroundXMLHttpRequest;
|
|
39567
|
-
}();
|
|
39568
|
-
|
|
39569
|
-
(0, _defineProperty2["default"])(CORBWorkaroundXMLHttpRequest, "UNSENT", 0);
|
|
39570
|
-
(0, _defineProperty2["default"])(CORBWorkaroundXMLHttpRequest, "OPENED", 1);
|
|
39571
|
-
(0, _defineProperty2["default"])(CORBWorkaroundXMLHttpRequest, "HEADERS_RECEIVED", 2);
|
|
39572
|
-
(0, _defineProperty2["default"])(CORBWorkaroundXMLHttpRequest, "LOADING", 3);
|
|
39573
|
-
(0, _defineProperty2["default"])(CORBWorkaroundXMLHttpRequest, "DONE", 4);
|
|
39574
|
-
return CORBWorkaroundXMLHttpRequest;
|
|
39575
|
-
}); // TODO add replacement fetch too?
|
|
39576
|
-
|
|
39577
|
-
exports.np = getXMLHttpRequest;
|
|
39578
|
-
var installGlobally = (0, _once["default"])(function () {
|
|
39579
|
-
window.XMLHttpRequest = getXMLHttpRequest();
|
|
39580
|
-
});
|
|
39581
|
-
__webpack_unused_export__ = installGlobally;
|
|
39582
|
-
|
|
39583
|
-
|
|
39584
|
-
/***/ }),
|
|
39585
|
-
|
|
39586
|
-
/***/ 917:
|
|
39587
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
39588
|
-
|
|
39589
|
-
"use strict";
|
|
39590
|
-
|
|
39591
|
-
|
|
39592
|
-
Object.defineProperty(exports, "__esModule", ({
|
|
39593
|
-
value: true
|
|
39594
|
-
}));
|
|
39595
|
-
exports.moduleId = void 0;
|
|
39596
|
-
var moduleId = '1f24 e53a';
|
|
39597
|
-
exports.moduleId = moduleId;
|
|
39598
|
-
|
|
39599
|
-
|
|
39600
|
-
/***/ }),
|
|
39601
|
-
|
|
39602
|
-
/***/ 5440:
|
|
39603
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
39604
|
-
|
|
39605
|
-
"use strict";
|
|
39606
|
-
|
|
39607
|
-
|
|
39608
|
-
var _interopRequireDefault = __webpack_require__(1654);
|
|
39609
|
-
|
|
39610
|
-
Object.defineProperty(exports, "__esModule", ({
|
|
39611
|
-
value: true
|
|
39612
|
-
}));
|
|
39613
|
-
exports["default"] = transferrables;
|
|
39614
|
-
|
|
39615
|
-
var _typeof2 = _interopRequireDefault(__webpack_require__(2990));
|
|
39616
|
-
|
|
39617
|
-
function transferrables(list) {
|
|
39618
|
-
return list.map(function (value) {
|
|
39619
|
-
if (value && (0, _typeof2["default"])(value) === 'object' && value.__proto__) {
|
|
39620
|
-
if (value.__proto__.constructor.name === 'ArrayBuffer') {
|
|
39621
|
-
return value;
|
|
39622
|
-
}
|
|
39623
|
-
|
|
39624
|
-
if (value.__proto__.__proto__ && value.__proto__.__proto__.constructor.name === 'TypedArray') {
|
|
39625
|
-
return value.buffer;
|
|
39626
|
-
}
|
|
39627
|
-
}
|
|
39628
|
-
}).filter(Boolean);
|
|
39629
|
-
}
|
|
39630
|
-
|
|
39631
|
-
|
|
39632
39463
|
/***/ }),
|
|
39633
39464
|
|
|
39634
39465
|
/***/ 5215:
|