@inboxsdk/core 2.1.60 → 2.1.62

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inboxsdk/core",
3
- "version": "2.1.60",
3
+ "version": "2.1.62",
4
4
  "description": "Library for building browser extensions for Gmail",
5
5
  "main": "inboxsdk.js",
6
6
  "author": "Streak",
package/pageWorld.js CHANGED
@@ -20363,6 +20363,26 @@ var __webpack_exports__ = {};
20363
20363
  (() => {
20364
20364
  /* eslint-disable @typescript-eslint/no-var-requires */
20365
20365
 
20366
+ // Protections against https://github.com/w3c/webextensions/issues/8 before
20367
+ // running for browsers that don't support the documentIds option to
20368
+ // scripting.executeScript():
20369
+ // 1. Check the page URL to make sure the page hasn't been navigated away from
20370
+ // Gmail since the injection was requested.
20371
+ // 2. Check that the document.head attribute the InboxSDK sets in the document
20372
+ // before injection is present, to make sure we're not in the situation where
20373
+ // the page has refreshed since the injection was requested and a new
20374
+ // injection was not requested yet.
20375
+ // 3. Check that a global variable this script sets is not already set to make
20376
+ // sure this script isn't running twice, to make sure we don't run twice if
20377
+ // we're in the situation where the page has refreshed since the injection
20378
+ // was requested and another injection was requested too.
20379
+ const pageOrigin = false || document.location.origin;
20380
+ if (pageOrigin !== 'https://mail.google.com') {
20381
+ throw new Error("Should not happen: InboxSDK pageWorld.js running in document that didn't request it.");
20382
+ }
20383
+ if (!document.head?.hasAttribute('data-inboxsdk-script-injected')) {
20384
+ throw new Error("Should not happen: InboxSDK pageWorld.js running in document that didn't request it.");
20385
+ }
20366
20386
  if (!__webpack_require__.g.__InboxSDKInjected) {
20367
20387
  __webpack_require__.g.__InboxSDKInjected = true;
20368
20388
  const logger = __webpack_require__(4530);
@@ -20384,13 +20404,8 @@ if (!__webpack_require__.g.__InboxSDKInjected) {
20384
20404
  const setupInboxCustomViewLinkFixer = (__webpack_require__(9234)/* ["default"] */ .A);
20385
20405
  const gmailInterceptor = (__webpack_require__(5691)/* ["default"] */ .A);
20386
20406
  const setupGmonkeyHandler = (__webpack_require__(8809)/* ["default"] */ .A);
20387
- const pageOrigin = false || document.location.origin;
20388
- if (pageOrigin === 'https://mail.google.com') {
20389
- gmailInterceptor();
20390
- setupGmonkeyHandler();
20391
- } else {
20392
- throw new Error('Should not happen');
20393
- }
20407
+ gmailInterceptor();
20408
+ setupGmonkeyHandler();
20394
20409
  extCorbWorkaroundPageWorld.init();
20395
20410
  xhrHelper();
20396
20411
  setupDataExposer();