@inboxsdk/core 2.1.61 → 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/background.js CHANGED
@@ -3,8 +3,18 @@ chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
3
3
  if (message.type === 'inboxsdk__injectPageWorld' && sender.tab) {
4
4
  if (chrome.scripting) {
5
5
  // MV3
6
+ let documentIds;
7
+ let frameIds;
8
+ if (sender.documentId) {
9
+ // Protect against https://github.com/w3c/webextensions/issues/8 in
10
+ // browsers (Chrome 106+) that support the documentId property.
11
+ // Protections for other browsers happen inside the injected script.
12
+ documentIds = [sender.documentId];
13
+ } else {
14
+ frameIds = [sender.frameId];
15
+ }
6
16
  chrome.scripting.executeScript({
7
- target: { tabId: sender.tab.id, frameIds: [sender.frameId] },
17
+ target: { tabId: sender.tab.id, documentIds, frameIds },
8
18
  world: 'MAIN',
9
19
  files: ['pageWorld.js'],
10
20
  });
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.1.61-1718747129530-da0f4707d79e342c";
374
+ const BUILD_VERSION = "2.1.62-1721349710708-8510fe512f666f95";
375
375
  if (false) {}
376
376
 
377
377
  /***/ }),
@@ -2646,7 +2646,7 @@ options.insert = htmlElement => {
2646
2646
  htmlElement.setAttribute('data-inboxsdk-version',
2647
2647
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- this is injected by webpack
2648
2648
  ///@ts-ignore
2649
- "2.1.61-1718747129530-da0f4707d79e342c");
2649
+ "2.1.62-1721349710708-8510fe512f666f95");
2650
2650
  document.head.append(htmlElement);
2651
2651
  };
2652
2652
  options.domAPI = (styleDomAPI_default());
@@ -10197,7 +10197,7 @@ options.insert = htmlElement => {
10197
10197
  htmlElement.setAttribute('data-inboxsdk-version',
10198
10198
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- this is injected by webpack
10199
10199
  ///@ts-ignore
10200
- "2.1.61-1718747129530-da0f4707d79e342c");
10200
+ "2.1.62-1721349710708-8510fe512f666f95");
10201
10201
  document.head.append(htmlElement);
10202
10202
  };
10203
10203
  options.domAPI = (styleDomAPI_default());
@@ -10481,19 +10481,16 @@ function logError(err, details, context) {
10481
10481
  // our own current stack just in case.
10482
10482
  const nowStack = getStackTrace();
10483
10483
  const stuffToLog = ['Error logged:', err];
10484
- if (err && err.stack) {
10485
- stuffToLog.push('\n\nOriginal error stack:\n' + err.stack);
10486
- }
10487
- stuffToLog.push('\n\nError logged from:\n' + nowStack);
10488
10484
  if (details) {
10489
10485
  stuffToLog.push('\n\nError details:', details);
10490
10486
  }
10491
- stuffToLog.push('\n\nExtension App Ids:', JSON.stringify(appIds, null, 2));
10492
- stuffToLog.push('\nSent by App:', sentByApp);
10493
- stuffToLog.push('\nSession Id:', sessionId);
10494
- stuffToLog.push('\nExtension Id:', get_extension_id());
10495
- stuffToLog.push('\nInboxSDK Loader Version:', loaderVersion);
10496
- stuffToLog.push('\nInboxSDK Implementation Version:', implVersion);
10487
+ stuffToLog.push(`\
10488
+ \n\nExtension App Ids: ${JSON.stringify(appIds, null, 2)}
10489
+ Sent by App: ${sentByApp}
10490
+ Session Id: ${sessionId}
10491
+ Extension Id: ${get_extension_id()}
10492
+ InboxSDK Loader Version: ${loaderVersion}
10493
+ InboxSDK Implementation Version: ${implVersion}`);
10497
10494
  console.error(...stuffToLog);
10498
10495
  const report = {
10499
10496
  message: err && err.message || err,
@@ -14944,7 +14941,7 @@ options.insert = htmlElement => {
14944
14941
  htmlElement.setAttribute('data-inboxsdk-version',
14945
14942
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- this is injected by webpack
14946
14943
  ///@ts-ignore
14947
- "2.1.61-1718747129530-da0f4707d79e342c");
14944
+ "2.1.62-1721349710708-8510fe512f666f95");
14948
14945
  document.head.append(htmlElement);
14949
14946
  };
14950
14947
  options.domAPI = (styleDomAPI_default());
@@ -19673,7 +19670,7 @@ mole_view_module_options.insert = htmlElement => {
19673
19670
  htmlElement.setAttribute('data-inboxsdk-version',
19674
19671
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- this is injected by webpack
19675
19672
  ///@ts-ignore
19676
- "2.1.61-1718747129530-da0f4707d79e342c");
19673
+ "2.1.62-1721349710708-8510fe512f666f95");
19677
19674
  document.head.append(htmlElement);
19678
19675
  };
19679
19676
  mole_view_module_options.domAPI = (styleDomAPI_default());
@@ -21406,13 +21403,11 @@ class GmailNavItemView {
21406
21403
  };
21407
21404
  const accessoryViewController = new dropdown_button_view_controller/* default */.A(buttonOptions);
21408
21405
  this._accessoryViewController = accessoryViewController;
21409
- const accessoryEl = (0,querySelectorOrFail/* default */.A)(this._element, '.Yh');
21410
- const parentNode = accessoryEl.parentNode;
21411
- if (parentNode) {
21412
- buttonOptions.buttonView.getElement().classList.add(...accessoryEl.classList);
21413
- parentNode.replaceChild(buttonOptions.buttonView.getElement(), accessoryEl);
21414
- this._iconSettings.iconElement = null;
21415
- }
21406
+ const accessoryEl = (0,querySelectorOrFail/* default */.A)(this._element, '.Yh:not(.inboxsdk__navItem_parent_accessory_button)');
21407
+ buttonOptions.buttonView.getElement().classList.add(...accessoryEl.classList);
21408
+ accessoryEl.style.display = 'none';
21409
+ accessoryEl.parentNode.appendChild(buttonOptions.buttonView.getElement());
21410
+ this._iconSettings.iconElement = null;
21416
21411
  return;
21417
21412
  }
21418
21413
 
@@ -21554,13 +21549,11 @@ class GmailNavItemView {
21554
21549
  // };
21555
21550
 
21556
21551
  this._accessoryViewController = new basic_button_view_controller/* default */.A(buttonOptions);
21557
- const accessoryEl = (0,querySelectorOrFail/* default */.A)(this._element, '.Yh');
21558
- const parentNode = accessoryEl.parentNode;
21559
- if (parentNode) {
21560
- buttonOptions.buttonView.getElement().classList.add(...accessoryEl.classList);
21561
- parentNode.replaceChild(buttonOptions.buttonView.getElement(), accessoryEl);
21562
- this._iconSettings.iconElement = null;
21563
- }
21552
+ const accessoryEl = (0,querySelectorOrFail/* default */.A)(this._element, '.Yh:not(.inboxsdk__navItem_parent_accessory_button)');
21553
+ buttonOptions.buttonView.getElement().classList.add(...accessoryEl.classList);
21554
+ accessoryEl.style.display = 'none';
21555
+ accessoryEl.parentNode.appendChild(buttonOptions.buttonView.getElement());
21556
+ this._iconSettings.iconElement = null;
21564
21557
  return;
21565
21558
  }
21566
21559
 
@@ -21837,7 +21830,11 @@ class GmailNavItemView {
21837
21830
  if (this._type === type) {
21838
21831
  return;
21839
21832
  }
21840
- const nameElement = this._element.querySelector('.inboxsdk__navItem_name');
21833
+ let nameElement = this._element.querySelector('.inboxsdk__navItem_name');
21834
+ if (nameElement && nameElement.closest('.inboxsdk__navItem') !== this._element) {
21835
+ // ignore the name element if it belongs to a child nav item
21836
+ nameElement = null;
21837
+ }
21841
21838
  switch (type) {
21842
21839
  case nav_item_types.GROUPER:
21843
21840
  case nav_item_types.NAVIGATION: