@inboxsdk/core 1.2.4 → 1.2.7
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 +4474 -463
- package/inboxsdk.js.map +1 -1
- package/package.json +1 -1
- package/pageWorld.js +1 -1
- package/pageWorld.js.map +1 -1
- package/src/common/load-script.d.ts +0 -6
- package/src/common/load-script.d.ts.map +1 -1
- package/src/inboxsdk-js/loading/platform-implementation-loader.d.ts.map +1 -1
- package/src/inboxsdk.d.ts +29 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/add-nav-item.d.ts +2 -2
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/add-nav-item.d.ts.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/isIntegratedViewGmail.d.ts +6 -1
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/isIntegratedViewGmail.d.ts.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver.d.ts +2 -2
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver.d.ts.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/gmail-element-getter.d.ts +5 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-element-getter.d.ts.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-attachment-card-view.d.ts +13 -5
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-attachment-card-view.d.ts.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-nav-item-view.d.ts +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-nav-item-view.d.ts.map +1 -1
- package/src/platform-implementation-js/lib/inject-script-EMBEDDED.d.ts.map +1 -1
- package/src/platform-implementation-js/namespaces/conversations.d.ts +7 -0
- package/src/platform-implementation-js/namespaces/conversations.d.ts.map +1 -1
- package/src/platform-implementation-js/namespaces/nav-menu.d.ts +4 -2
- package/src/platform-implementation-js/namespaces/nav-menu.d.ts.map +1 -1
- package/src/platform-implementation-js/views/conversations/attachment-card-view.d.ts +12 -5
- package/src/platform-implementation-js/views/conversations/attachment-card-view.d.ts.map +1 -1
- package/src/platform-implementation-js/views/native-nav-item-view.d.ts +2 -1
- package/src/platform-implementation-js/views/native-nav-item-view.d.ts.map +1 -1
- package/src/build/exec.js +0 -26
- package/src/build/spawn.js +0 -17
- package/src/common/ajax.js +0 -90
- package/src/common/cachebust-url.js +0 -10
- package/src/common/censorHTMLstring.js +0 -37
- package/src/common/censorHTMLtree.js +0 -28
- package/src/common/censorJSONTree.js +0 -15
- package/src/common/connectivity-test.js +0 -21
- package/src/common/defer.js +0 -11
- package/src/common/find-parent.js +0 -10
- package/src/common/get-extension-id.js +0 -7
- package/src/common/get-or-fail.js +0 -8
- package/src/common/get-session-id.js +0 -14
- package/src/common/get-stack-trace.js +0 -6
- package/src/common/html-to-text.js +0 -7
- package/src/common/isElementVisible.js +0 -6
- package/src/common/load-script.js +0 -128
- package/src/common/log-error.js +0 -185
- package/src/common/quoted-split.js +0 -18
- package/src/common/rate-limit-queuer.js +0 -57
- package/src/common/rate-limit.js +0 -14
- package/src/common/version.js +0 -8
- package/src/inboxsdk-js/header.js +0 -19
- package/src/inboxsdk-js/inboxsdk-NONREMOTE-INTEGRATED-PAGEWORLD.js +0 -4
- package/src/inboxsdk-js/inboxsdk-NONREMOTE.js +0 -4
- package/src/inboxsdk-js/inboxsdk-REMOTE.js +0 -2
- package/src/inboxsdk-js/inboxsdk-TEST.js +0 -5
- package/src/inboxsdk-js/inboxsdk.js +0 -23
- package/src/inboxsdk-js/loading/load-platform-implementation-DEV.js +0 -14
- package/src/inboxsdk-js/loading/platform-implementation-loader.js +0 -31
- package/src/injected-js/gmail/constants.js +0 -2
- package/src/injected-js/gmail/modify-suggestions.js +0 -106
- package/src/injected-js/gmail/setup-gmail-interceptor.js +0 -936
- package/src/injected-js/gmail/setup-gmonkey-handler.js +0 -49
- package/src/injected-js/gmail/sync-compose-processor-20220909.js +0 -298
- package/src/injected-js/gmail/sync-compose-processor.js +0 -55
- package/src/injected-js/gmail/sync-compose-request-processor.js +0 -109
- package/src/injected-js/gmail/thread-identifier/click-and-get-popup-url.js +0 -71
- package/src/injected-js/gmail/thread-identifier/index.js +0 -133
- package/src/injected-js/gmail/thread-identifier/thread-row-parser.js +0 -61
- package/src/injected-js/injected-logger.js +0 -50
- package/src/injected-js/main.js +0 -49
- package/src/injected-js/message-metadata-holder.js +0 -103
- package/src/injected-js/setup-data-exposer.js +0 -135
- package/src/injected-js/setup-error-silencer.js +0 -15
- package/src/injected-js/setup-event-reemitter.js +0 -47
- package/src/injected-js/setupCustomViewEventAssassin.js +0 -90
- package/src/injected-js/setupInboxCustomViewLinkFixer.js +0 -24
- package/src/injected-js/setupPushStateListener.js +0 -14
- package/src/injected-js/xhr-helper.js +0 -43
- package/src/injected-js/xhr-proxy-factory.js +0 -537
- package/src/platform-implementation-js/constants/nav-item-types.js +0 -19
- package/src/platform-implementation-js/constants/router.js +0 -60
- package/src/platform-implementation-js/constants/toolbars.js +0 -5
- package/src/platform-implementation-js/dom-driver/gmail/gmail-butter-bar-driver.js +0 -158
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/add-app-menu-item.js +0 -20
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/add-collapsible-panel.js +0 -38
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/add-nav-item.js +0 -98
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/add-support-item.js +0 -4
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/add-toolbar-button-for-app.js +0 -14
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/create-link.js +0 -60
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/encodeDraftUrlId.js +0 -8
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/get-draft-id-for-message-id.js +0 -47
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/get-native-nav-item.js +0 -31
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/get-rfc-message-id-for-gmail-message-id.js +0 -12
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/get-rfc-message-id-for-gmail-thread-id.js +0 -33
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/get-url-object.js +0 -22
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/getSyncThreadForOldGmailThreadId.js +0 -18
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/getSyncThreadFromSyncThreadId.js +0 -57
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/gmail-load-event.js +0 -40
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/goto-view.js +0 -55
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/isIntegratedViewGmail.js +0 -14
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/keyboard-shortcut-help-modifier.js +0 -177
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/open-compose-window.js +0 -17
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/open-draft-by-message-id.js +0 -44
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/override-gmail-back-button.js +0 -49
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/register-search-query-rewriter.js +0 -18
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/register-search-suggestions-provider.js +0 -138
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/setup-compose-view-driver-stream.js +0 -112
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/setup-route-view-driver-stream.js +0 -152
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/show-app-id-warning.js +0 -21
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/show-custom-route-view.js +0 -48
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/show-custom-thread-list.js +0 -357
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/show-native-route-view.js +0 -19
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/suppressAddon.js +0 -36
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/temporary-track-download-url-validity.js +0 -36
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/thread-row-identifier.js +0 -85
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/track-events.js +0 -142
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/track-gmail-styles.js +0 -115
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/user-info.js +0 -50
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver.js +0 -723
- package/src/platform-implementation-js/dom-driver/gmail/gmail-element-getter/get-main-content-element-changed-stream.js +0 -38
- package/src/platform-implementation-js/dom-driver/gmail/gmail-element-getter/wait-for-gmail-mode-to-settle.js +0 -12
- package/src/platform-implementation-js/dom-driver/gmail/gmail-element-getter.js +0 -264
- package/src/platform-implementation-js/dom-driver/gmail/gmail-page-communicator.js +0 -201
- package/src/platform-implementation-js/dom-driver/gmail/gmail-response-processor.js +0 -532
- package/src/platform-implementation-js/dom-driver/gmail/gmail-sync-response-processor.js +0 -300
- package/src/platform-implementation-js/dom-driver/gmail/is-compose-titlebar-light-color.js +0 -21
- package/src/platform-implementation-js/dom-driver/gmail/make-xhr-interceptor.js +0 -92
- package/src/platform-implementation-js/dom-driver/gmail/makePageParserTree.js +0 -28
- package/src/platform-implementation-js/dom-driver/gmail/pageParserOptions.js +0 -19
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-app-menu-item-view.js +0 -129
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-app-sidebar-view/index.js +0 -80
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-app-sidebar-view/primary/add-companion-global-icon-area.js +0 -23
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-app-sidebar-view/primary/add-companion-thread-icon-area.js +0 -26
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-app-sidebar-view/primary/add-to-icon-area.js +0 -16
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-app-sidebar-view/primary/index.js +0 -723
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-app-toolbar-button-view/monitor-top-banner-size-and-react.js +0 -24
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-app-toolbar-button-view.js +0 -172
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-attachment-area-view.js +0 -106
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-attachment-card-view.js +0 -328
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-backdrop.js +0 -22
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-collapsible-section-view.js +0 -720
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/add-button.js +0 -135
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/add-compose-notice.js +0 -50
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/add-recipient-row.js +0 -65
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/add-status-bar.js +0 -101
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/add-tooltip-to-button.js +0 -66
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/detectClassicRecipientsArea.js +0 -38
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/ensure-app-button-toolbars-are-closed.js +0 -10
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/ensure-grouping-is-open.js +0 -14
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/focus.js +0 -13
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/from-manager.js +0 -60
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/get-additional-action-toolbar.js +0 -54
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/get-address-changes-stream.js +0 -98
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/get-address-information-extractor.js +0 -28
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/get-body-changes-stream.js +0 -13
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/get-formatting-area-offset-left.js +0 -18
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/get-minimized-stream.js +0 -16
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/get-recipients.js +0 -22
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/get-response-type-changes-stream.js +0 -23
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/gmail-compose-button-view.js +0 -233
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/insert-link-into-body.js +0 -19
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/manage-button-grouping.js +0 -355
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/monitor-selection-range.js +0 -21
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/override-edit-subject.js +0 -63
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/page-parser.js +0 -223
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/position-formatting-toolbar.js +0 -19
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/set-recipients.js +0 -157
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/setupLinkPopovers.js +0 -109
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/size-fixer.js +0 -123
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/update-insert-more-area-left.js +0 -16
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view.js +0 -1542
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-message-view/attachment-icon.js +0 -4
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-message-view/get-updated-contact.js +0 -75
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-message-view.js +0 -737
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-nav-item-view.js +0 -763
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-route-view/gmail-route-processor.js +0 -103
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-route-view/gmail-route-view.js +0 -508
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-row-list-view.js +0 -236
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-support-item-view.js +0 -84
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-thread-row-view.js +0 -986
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-thread-view/width-manager.js +0 -26
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-thread-view.js +0 -658
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-toolbar-view.js +0 -459
- package/src/platform-implementation-js/dom-driver/gmail/views/native-gmail-nav-item-view.js +0 -265
- package/src/platform-implementation-js/dom-driver/gmail/widgets/buttons/button-color-classes.js +0 -33
- package/src/platform-implementation-js/dom-driver/gmail/widgets/buttons/button-view.js +0 -325
- package/src/platform-implementation-js/dom-driver/gmail/widgets/buttons/create-accessory-button-view.js +0 -61
- package/src/platform-implementation-js/dom-driver/gmail/widgets/buttons/create-parent-accessory-button-view.js +0 -58
- package/src/platform-implementation-js/dom-driver/gmail/widgets/buttons/inbox-dropdown-button-view.js +0 -23
- package/src/platform-implementation-js/dom-driver/gmail/widgets/buttons/modal-button-view.js +0 -101
- package/src/platform-implementation-js/dom-driver/gmail/widgets/buttons/more-dropdown-button-view.js +0 -30
- package/src/platform-implementation-js/dom-driver/gmail/widgets/buttons/more-parent-accessory-button-view.js +0 -10
- package/src/platform-implementation-js/dom-driver/gmail/widgets/gmail-action-button-view.js +0 -42
- package/src/platform-implementation-js/dom-driver/gmail/widgets/gmail-dropdown-view.js +0 -22
- package/src/platform-implementation-js/dom-driver/gmail/widgets/gmail-label-view.js +0 -112
- package/src/platform-implementation-js/dom-driver/gmail/widgets/gmail-modal-view-driver.js +0 -122
- package/src/platform-implementation-js/dom-driver/gmail/widgets/gmail-mole-view-driver.js +0 -194
- package/src/platform-implementation-js/dom-driver/gmail/widgets/gmail-tooltip-view.js +0 -352
- package/src/platform-implementation-js/dom-driver/gmail/widgets/gmail-top-message-bar-driver.js +0 -76
- package/src/platform-implementation-js/dom-driver/inbox/views/inbox-backdrop.js +0 -57
- package/src/platform-implementation-js/dom-driver/inbox/views/inbox-drawer-view.js +0 -291
- package/src/platform-implementation-js/driver-common/compose/getDiscardStream.js +0 -28
- package/src/platform-implementation-js/driver-common/compose/getPresendingStream.js +0 -46
- package/src/platform-implementation-js/driver-common/getAccountUrlPart.js +0 -17
- package/src/platform-implementation-js/driver-common/getGmailMessageIdForSyncMessageId.js +0 -17
- package/src/platform-implementation-js/driver-common/getGmailThreadIdForRfcMessageId.js +0 -44
- package/src/platform-implementation-js/driver-common/getOriginalMessagePage.js +0 -33
- package/src/platform-implementation-js/driver-common/getRfcMessageIdForSyncMessageId.js +0 -18
- package/src/platform-implementation-js/driver-common/getSyncThreadsForSearch.js +0 -49
- package/src/platform-implementation-js/driver-common/getThreadIdFromMessageId.js +0 -13
- package/src/platform-implementation-js/driver-common/gmailAjax.js +0 -65
- package/src/platform-implementation-js/driver-common/inboxAjax.js +0 -5
- package/src/platform-implementation-js/driver-common/render-custom-icon.js +0 -16
- package/src/platform-implementation-js/driver-common/requestGmailThread.js +0 -24
- package/src/platform-implementation-js/driver-common/sidebar/AppSidebar.js +0 -245
- package/src/platform-implementation-js/driver-common/sidebar/ContentPanelViewDriver.js +0 -144
- package/src/platform-implementation-js/driver-common/sidebar/constants.js +0 -26
- package/src/platform-implementation-js/driver-common/update-icon.js +0 -90
- package/src/platform-implementation-js/driver-interfaces/compose-view-driver.js +0 -1
- package/src/platform-implementation-js/driver-interfaces/driver.js +0 -1
- package/src/platform-implementation-js/driver-interfaces/mole-view-driver.js +0 -1
- package/src/platform-implementation-js/driver-interfaces/route-view-driver.js +0 -1
- package/src/platform-implementation-js/lib/ErrorCollector.js +0 -47
- package/src/platform-implementation-js/lib/Membrane.js +0 -22
- package/src/platform-implementation-js/lib/ScrollableContainByScreen.js +0 -30
- package/src/platform-implementation-js/lib/attemptWithRetries.js +0 -16
- package/src/platform-implementation-js/lib/common-page-communicator.js +0 -137
- package/src/platform-implementation-js/lib/copyAndValidateAutocompleteResults.js +0 -35
- package/src/platform-implementation-js/lib/css-selector-escape.js +0 -6
- package/src/platform-implementation-js/lib/delay-asap.js +0 -10
- package/src/platform-implementation-js/lib/delay-idle.js +0 -16
- package/src/platform-implementation-js/lib/dom/block-and-reemit-keyboard-events.js +0 -36
- package/src/platform-implementation-js/lib/dom/custom-events.js +0 -5
- package/src/platform-implementation-js/lib/dom/element-view-mapper.js +0 -9
- package/src/platform-implementation-js/lib/dom/generic-button-view.js +0 -39
- package/src/platform-implementation-js/lib/dom/get-insert-before-element.js +0 -39
- package/src/platform-implementation-js/lib/dom/get-selection.js +0 -30
- package/src/platform-implementation-js/lib/dom/insert-element-in-order.js +0 -38
- package/src/platform-implementation-js/lib/dom/insert-html-at-cursor.js +0 -83
- package/src/platform-implementation-js/lib/dom/is-node-in-range.js +0 -12
- package/src/platform-implementation-js/lib/dom/keyboard-shortcut-stream.js +0 -12
- package/src/platform-implementation-js/lib/dom/make-element-child-stream.js +0 -79
- package/src/platform-implementation-js/lib/dom/make-element-stream-merger.js +0 -27
- package/src/platform-implementation-js/lib/dom/make-element-view-stream.js +0 -15
- package/src/platform-implementation-js/lib/dom/make-mutation-observer-chunked-stream.js +0 -15
- package/src/platform-implementation-js/lib/dom/make-mutation-observer-stream.js +0 -5
- package/src/platform-implementation-js/lib/dom/on-mouse-down-and-up.js +0 -8
- package/src/platform-implementation-js/lib/dom/outsideClicksAndEscape.js +0 -38
- package/src/platform-implementation-js/lib/dom/parentNodes.js +0 -8
- package/src/platform-implementation-js/lib/dom/querySelectorOrFail.js +0 -6
- package/src/platform-implementation-js/lib/dom/reemitClickEventForReact.js +0 -22
- package/src/platform-implementation-js/lib/dom/set-css.js +0 -20
- package/src/platform-implementation-js/lib/dom/simulate-drag-and-drop.js +0 -88
- package/src/platform-implementation-js/lib/dom/simulate-key.js +0 -46
- package/src/platform-implementation-js/lib/dom/simulate-mouse-event.js +0 -16
- package/src/platform-implementation-js/lib/dom/trigger-relay-event.js +0 -7
- package/src/platform-implementation-js/lib/extract-contact-from-email-contact-string.js +0 -25
- package/src/platform-implementation-js/lib/fake-window-resize.js +0 -5
- package/src/platform-implementation-js/lib/from-event-target-capture.js +0 -12
- package/src/platform-implementation-js/lib/fromEventsWithOptions.js +0 -10
- package/src/platform-implementation-js/lib/handle-compose-link-chips.js +0 -124
- package/src/platform-implementation-js/lib/handler-registry.js +0 -67
- package/src/platform-implementation-js/lib/idMap.js +0 -40
- package/src/platform-implementation-js/lib/imageRequest.js +0 -8
- package/src/platform-implementation-js/lib/incrementName.js +0 -7
- package/src/platform-implementation-js/lib/inject-script-EMBEDDED.js +0 -8
- package/src/platform-implementation-js/lib/inject-script.js +0 -33
- package/src/platform-implementation-js/lib/insert-link-chip-into-body.js +0 -44
- package/src/platform-implementation-js/lib/is-valid-app-id.js +0 -27
- package/src/platform-implementation-js/lib/is-valid-email.js +0 -14
- package/src/platform-implementation-js/lib/isNotNil.js +0 -5
- package/src/platform-implementation-js/lib/isStreakAppId.js +0 -11
- package/src/platform-implementation-js/lib/logger.js +0 -439
- package/src/platform-implementation-js/lib/parseParamsFromRouteID.js +0 -10
- package/src/platform-implementation-js/lib/persistent-queue.js +0 -107
- package/src/platform-implementation-js/lib/populateRouteID.js +0 -17
- package/src/platform-implementation-js/lib/react/ElementContainer.js +0 -26
- package/src/platform-implementation-js/lib/routeIDmatchesHash.js +0 -8
- package/src/platform-implementation-js/lib/safe-event-emitter.js +0 -16
- package/src/platform-implementation-js/lib/stopper-pool.js +0 -41
- package/src/platform-implementation-js/lib/stream-wait-for.js +0 -30
- package/src/platform-implementation-js/lib/toItemWithLifetimeStream.js +0 -12
- package/src/platform-implementation-js/lib/toLiveSet.js +0 -22
- package/src/platform-implementation-js/lib/wait-for.js +0 -38
- package/src/platform-implementation-js/lib/waitForAsync.js +0 -18
- package/src/platform-implementation-js/main-INTEGRATED-PAGEWORLD.js +0 -5
- package/src/platform-implementation-js/main.js +0 -42
- package/src/platform-implementation-js/namespaces/app-menu.js +0 -81
- package/src/platform-implementation-js/namespaces/butter-bar.js +0 -163
- package/src/platform-implementation-js/namespaces/compose.js +0 -59
- package/src/platform-implementation-js/namespaces/conversations.js +0 -83
- package/src/platform-implementation-js/namespaces/global.js +0 -30
- package/src/platform-implementation-js/namespaces/keyboard.js +0 -30
- package/src/platform-implementation-js/namespaces/lists.js +0 -40
- package/src/platform-implementation-js/namespaces/modal.js +0 -43
- package/src/platform-implementation-js/namespaces/nav-menu.js +0 -33
- package/src/platform-implementation-js/namespaces/router.js +0 -139
- package/src/platform-implementation-js/namespaces/search.js +0 -29
- package/src/platform-implementation-js/namespaces/toolbars.js +0 -147
- package/src/platform-implementation-js/namespaces/user.js +0 -57
- package/src/platform-implementation-js/namespaces/widgets.js +0 -73
- package/src/platform-implementation-js/platform-implementation.js +0 -178
- package/src/platform-implementation-js/views/SimpleElementView.js +0 -16
- package/src/platform-implementation-js/views/app-menu-item-view.js +0 -442
- package/src/platform-implementation-js/views/app-toolbar-button-view.js +0 -43
- package/src/platform-implementation-js/views/collapsible-panel-view.js +0 -256
- package/src/platform-implementation-js/views/collapsible-section-view.js +0 -63
- package/src/platform-implementation-js/views/compose-button-view.js +0 -45
- package/src/platform-implementation-js/views/compose-view.js +0 -310
- package/src/platform-implementation-js/views/content-panel-view.js +0 -36
- package/src/platform-implementation-js/views/conversations/attachment-card-view.js +0 -41
- package/src/platform-implementation-js/views/conversations/custom-message-view.js +0 -117
- package/src/platform-implementation-js/views/conversations/message-view.js +0 -203
- package/src/platform-implementation-js/views/conversations/thread-view.js +0 -97
- package/src/platform-implementation-js/views/keyboard-shortcut-handle.js +0 -14
- package/src/platform-implementation-js/views/native-nav-item-view.js +0 -60
- package/src/platform-implementation-js/views/nav-item-view.js +0 -130
- package/src/platform-implementation-js/views/route-view/custom-route-view.js +0 -25
- package/src/platform-implementation-js/views/route-view/dummy-route-view-driver.js +0 -29
- package/src/platform-implementation-js/views/route-view/list-route-view.js +0 -46
- package/src/platform-implementation-js/views/route-view/route-view.js +0 -47
- package/src/platform-implementation-js/views/section-view.js +0 -60
- package/src/platform-implementation-js/views/thread-row-view.js +0 -90
- package/src/platform-implementation-js/widgets/buttons/basic-button-view-controller.js +0 -39
- package/src/platform-implementation-js/widgets/buttons/dropdown-button-view-controller.js +0 -98
- package/src/platform-implementation-js/widgets/buttons/dropdown-view.js +0 -121
- package/src/platform-implementation-js/widgets/drawer-view.js +0 -46
- package/src/platform-implementation-js/widgets/modal-view.js +0 -108
- package/src/platform-implementation-js/widgets/mole-view.js +0 -38
- package/src/platform-implementation-js/widgets/top-message-bar-view.js +0 -15
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import Sha1 from 'sha.js/sha1';
|
|
2
|
-
function grandfatherHash(x) {
|
|
3
|
-
const hasher = new Sha1();
|
|
4
|
-
hasher.update('YlEHtGl72+c' + x);
|
|
5
|
-
return hasher.digest('hex');
|
|
6
|
-
}
|
|
7
|
-
const whitelist = new Set([
|
|
8
|
-
'b540a2819e4b26823288046869e5577852178d69',
|
|
9
|
-
'1e9084cb394369dcdfd43cfcd84d17b78b0903dd',
|
|
10
|
-
'a9b816b86b6085eb0b80315da6b2297ff30cf7b6',
|
|
11
|
-
'5140e277522fd95ece3d540c94b97f443bcc3256',
|
|
12
|
-
'b56a2d6e6f650ed6eae78774d3b1f02d969d8485',
|
|
13
|
-
'bc6308648a588258f31f8f4b64f7c4652b6fcaac',
|
|
14
|
-
'4cb8e6bd1aab0b4b05c7f07fbe8332b842009358', // godMode
|
|
15
|
-
]);
|
|
16
|
-
const appIdRegex = /^sdk_(.{5,15})_([0-9a-f]{10})$/;
|
|
17
|
-
export default function isValidAppId(appId) {
|
|
18
|
-
if (whitelist.has(grandfatherHash(appId)))
|
|
19
|
-
return true;
|
|
20
|
-
const m = appIdRegex.exec(appId);
|
|
21
|
-
if (!m)
|
|
22
|
-
return false;
|
|
23
|
-
const name = m[1], hash = m[2];
|
|
24
|
-
const shasum = new Sha1();
|
|
25
|
-
shasum.update(name);
|
|
26
|
-
return shasum.digest('hex').slice(0, 10) === hash;
|
|
27
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
const re = /^([^<>()[\]\\,;:\s"]+|".+")@[^\s<>]+$/;
|
|
2
|
-
// This function is supposed to be pretty forgiving because emails can have
|
|
3
|
-
// almost anything in their From header. This function exists as a sanity check
|
|
4
|
-
// to make sure that we didn't try to read from the wrong DOM element. It
|
|
5
|
-
// passes anything with at least one @ sign that doesn't contain certain
|
|
6
|
-
// symbols. We might want to make it even less strict and allow more symbols if
|
|
7
|
-
// it turns out people are legitimately receiving emails with these in the From
|
|
8
|
-
// or other recipient headers.
|
|
9
|
-
export default function isValidEmail(candidate) {
|
|
10
|
-
if (candidate == null) {
|
|
11
|
-
return false;
|
|
12
|
-
}
|
|
13
|
-
return re.test(candidate);
|
|
14
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import Sha256 from 'sha.js/sha256';
|
|
2
|
-
function hash(x) {
|
|
3
|
-
const hasher = new Sha256();
|
|
4
|
-
hasher.update('bdnanNrDjv' + x);
|
|
5
|
-
return hasher.digest('hex').slice(0, 32);
|
|
6
|
-
}
|
|
7
|
-
export default function isStreakAppId(appId) {
|
|
8
|
-
// Checks if appId === 'sdk_streak_21e9788951' without putting the appId in
|
|
9
|
-
// the source. Just using a similar technique to is-valid-app-id.
|
|
10
|
-
return hash(appId) === 'f471fe7b7343b47a202437c3962cc335';
|
|
11
|
-
}
|
|
@@ -1,439 +0,0 @@
|
|
|
1
|
-
import Sha256 from 'sha.js/sha256';
|
|
2
|
-
import ajax from '../../common/ajax';
|
|
3
|
-
import getExtensionId from '../../common/get-extension-id';
|
|
4
|
-
import getSessionId from '../../common/get-session-id';
|
|
5
|
-
import logError from '../../common/log-error';
|
|
6
|
-
import PersistentQueue from './persistent-queue';
|
|
7
|
-
import makeMutationObserverStream from './dom/make-mutation-observer-stream';
|
|
8
|
-
import { getXMLHttpRequest } from 'ext-corb-workaround';
|
|
9
|
-
import isStreakAppId from './isStreakAppId';
|
|
10
|
-
// Yeah, this module is a singleton with some shared state. This is just for
|
|
11
|
-
// logging convenience. Other modules should avoid doing this!
|
|
12
|
-
const _extensionAppIds = [];
|
|
13
|
-
let _extensionLoaderVersion;
|
|
14
|
-
let _extensionImplVersion;
|
|
15
|
-
let _extensionUserEmailHash;
|
|
16
|
-
let _extensionUseEventTracking = false;
|
|
17
|
-
let _isUsingSyncAPI = undefined;
|
|
18
|
-
const _sessionId = getSessionId();
|
|
19
|
-
const _loggedDeprecatedMessages = new Set();
|
|
20
|
-
// The logger master is the first InboxSDK extension to load. This
|
|
21
|
-
// first extension is tasked with reporting tracked events to the server.
|
|
22
|
-
const _extensionIsLoggerMaster = (function () {
|
|
23
|
-
if (typeof document === 'undefined') {
|
|
24
|
-
return true; // for unit tests
|
|
25
|
-
}
|
|
26
|
-
if (document.documentElement.hasAttribute('data-inboxsdk-master-claimed')) {
|
|
27
|
-
return false;
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
document.documentElement.setAttribute('data-inboxsdk-master-claimed', 'true');
|
|
31
|
-
return true;
|
|
32
|
-
}
|
|
33
|
-
})();
|
|
34
|
-
function getAllAppIds() {
|
|
35
|
-
const str = (typeof document !== 'undefined' &&
|
|
36
|
-
document.documentElement.getAttribute('data-inboxsdk-active-app-ids')) ||
|
|
37
|
-
'[]';
|
|
38
|
-
return JSON.parse(str);
|
|
39
|
-
}
|
|
40
|
-
const _trackedEventsQueue = new PersistentQueue('events');
|
|
41
|
-
const FIRST_LOADED_TIME = Date.now();
|
|
42
|
-
export default class Logger {
|
|
43
|
-
_appId;
|
|
44
|
-
_isMaster;
|
|
45
|
-
constructor(appId, opts, loaderVersion, implVersion) {
|
|
46
|
-
_extensionLoggerSetup(appId, opts, loaderVersion, implVersion);
|
|
47
|
-
this._appId = appId;
|
|
48
|
-
this._isMaster = (() => {
|
|
49
|
-
if (!_extensionUseEventTracking ||
|
|
50
|
-
(typeof document !== 'undefined' &&
|
|
51
|
-
document.documentElement.hasAttribute('data-inboxsdk-app-logger-master-chosen'))) {
|
|
52
|
-
return false;
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
document.documentElement.setAttribute('data-inboxsdk-app-logger-master-chosen', 'true');
|
|
56
|
-
return true;
|
|
57
|
-
}
|
|
58
|
-
})();
|
|
59
|
-
if (this._isMaster && typeof document !== 'undefined') {
|
|
60
|
-
document.addEventListener('inboxSDKinjectedError', (event) => {
|
|
61
|
-
if (!(event instanceof CustomEvent && event?.detail)) {
|
|
62
|
-
this.error(new Error('Invalid inboxSDKinjectedError event'), event);
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
const detail = event.detail;
|
|
66
|
-
this.error(Object.assign(new Error(detail.message), { stack: detail.stack }), detail.details);
|
|
67
|
-
});
|
|
68
|
-
document.addEventListener('inboxSDKinjectedEventSdkPassive', (event) => {
|
|
69
|
-
const detail = event.detail;
|
|
70
|
-
this.eventSdkPassive(detail.name, detail.details, detail.sensitive);
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
setUserEmailAddress(email) {
|
|
75
|
-
_extensionUserEmailHash = hashEmail(email);
|
|
76
|
-
}
|
|
77
|
-
shouldTrackEverything() {
|
|
78
|
-
return (_extensionUserEmailHash ===
|
|
79
|
-
'ca05afe92819df590a4196c31814fdb24050e8f49d8a41613f3d6cfb5729c785');
|
|
80
|
-
}
|
|
81
|
-
setIsUsingSyncAPI(isUsing) {
|
|
82
|
-
_isUsingSyncAPI = isUsing;
|
|
83
|
-
}
|
|
84
|
-
static run(cb, details) {
|
|
85
|
-
try {
|
|
86
|
-
return cb();
|
|
87
|
-
}
|
|
88
|
-
catch (err) {
|
|
89
|
-
Logger.error(err, details);
|
|
90
|
-
throw err;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
run(cb, details) {
|
|
94
|
-
try {
|
|
95
|
-
return cb();
|
|
96
|
-
}
|
|
97
|
-
catch (err) {
|
|
98
|
-
this.error(err, details);
|
|
99
|
-
throw err;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
static error(err, details) {
|
|
103
|
-
_logError(err, details, undefined, false);
|
|
104
|
-
}
|
|
105
|
-
error(err, details) {
|
|
106
|
-
_logError(err, details, this._appId, false);
|
|
107
|
-
}
|
|
108
|
-
errorApp(err, details) {
|
|
109
|
-
_logError(err, details, this._appId, true);
|
|
110
|
-
}
|
|
111
|
-
errorSite(err, details) {
|
|
112
|
-
// Only the first logger instance reports Site errors.
|
|
113
|
-
if (!this._isMaster) {
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
this.error(err, details);
|
|
117
|
-
}
|
|
118
|
-
// Should only be used by the InboxSDK users for their own app events.
|
|
119
|
-
eventApp(name, details) {
|
|
120
|
-
_trackEvent(this._appId, 'app', name, details);
|
|
121
|
-
}
|
|
122
|
-
// For tracking app events that are possibly triggered by the user. Extensions
|
|
123
|
-
// can opt out of this with a flag passed to InboxSDK.load().
|
|
124
|
-
eventSdkActive(name, details) {
|
|
125
|
-
if (!_extensionUseEventTracking) {
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
_trackEvent(this._appId, 'sdkActive', name, details);
|
|
129
|
-
}
|
|
130
|
-
// Track events unrelated to user activity about how the app uses the SDK.
|
|
131
|
-
// Examples include the app being initialized, and calls to any of the
|
|
132
|
-
// register___ViewHandler functions.
|
|
133
|
-
eventSdkPassive(name, details, sensitive) {
|
|
134
|
-
if (sensitive && !isStreakAppId(this._appId)) {
|
|
135
|
-
// do not log events if they were marked as sensitive
|
|
136
|
-
return;
|
|
137
|
-
}
|
|
138
|
-
_trackEvent(this._appId, 'sdkPassive', name, details);
|
|
139
|
-
}
|
|
140
|
-
// Track Site events.
|
|
141
|
-
eventSite(name, details) {
|
|
142
|
-
// Only the first logger instance reports Site events.
|
|
143
|
-
if (!this._isMaster) {
|
|
144
|
-
return;
|
|
145
|
-
}
|
|
146
|
-
_trackEvent(this._appId, 'gmail', name, details);
|
|
147
|
-
}
|
|
148
|
-
deprecationWarning(name, suggestion) {
|
|
149
|
-
console.warn(`InboxSDK: ${name} is deprecated.` +
|
|
150
|
-
(suggestion ? ` Please use ${suggestion} instead.` : ''));
|
|
151
|
-
const key = name + (suggestion ? ':' + suggestion : '');
|
|
152
|
-
if (!_loggedDeprecatedMessages.has(key)) {
|
|
153
|
-
this.eventSdkPassive(`deprecated.${name}`);
|
|
154
|
-
_loggedDeprecatedMessages.add(key);
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
getAppLogger() {
|
|
158
|
-
return {
|
|
159
|
-
error: (err, details) => this.errorApp(err, details),
|
|
160
|
-
event: (name, details) => this.eventApp(name, details),
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
|
-
trackFunctionPerformance(fn, sampleRate, details) {
|
|
164
|
-
if (Math.random() < sampleRate &&
|
|
165
|
-
document.visibilityState === 'visible' &&
|
|
166
|
-
this._isMaster) {
|
|
167
|
-
const start = Date.now();
|
|
168
|
-
fn();
|
|
169
|
-
setTimeout(() => {
|
|
170
|
-
const now = Date.now();
|
|
171
|
-
this.eventSdkPassive('function performance result', {
|
|
172
|
-
value: now - start,
|
|
173
|
-
timeSinceFirstLoad: now - FIRST_LOADED_TIME,
|
|
174
|
-
...details,
|
|
175
|
-
});
|
|
176
|
-
}, 10);
|
|
177
|
-
}
|
|
178
|
-
else {
|
|
179
|
-
fn();
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
function _extensionLoggerSetup(appId, opts, loaderVersion, implVersion) {
|
|
184
|
-
_extensionAppIds.push(Object.freeze({
|
|
185
|
-
appId: appId,
|
|
186
|
-
version: opts.appVersion || undefined,
|
|
187
|
-
}));
|
|
188
|
-
document.documentElement.setAttribute('data-inboxsdk-active-app-ids', JSON.stringify(getAllAppIds().concat([
|
|
189
|
-
{
|
|
190
|
-
appId: appId,
|
|
191
|
-
version: opts.appVersion || undefined,
|
|
192
|
-
},
|
|
193
|
-
])));
|
|
194
|
-
if (_extensionLoaderVersion) {
|
|
195
|
-
return;
|
|
196
|
-
}
|
|
197
|
-
_extensionLoaderVersion = loaderVersion;
|
|
198
|
-
_extensionImplVersion = implVersion;
|
|
199
|
-
_extensionUseEventTracking = opts.eventTracking;
|
|
200
|
-
if (opts.globalErrorLogging) {
|
|
201
|
-
if (Error.stackTraceLimit < 40) {
|
|
202
|
-
Error.stackTraceLimit = 40;
|
|
203
|
-
}
|
|
204
|
-
window.addEventListener('error', function (event) {
|
|
205
|
-
// Ugh, currently Chrome makes this pretty useless. Once Chrome fixes
|
|
206
|
-
// this, we can remove the logged function wrappers around setTimeout and
|
|
207
|
-
// things.
|
|
208
|
-
if (event.error) {
|
|
209
|
-
Logger.error(event.error, 'Uncaught exception');
|
|
210
|
-
}
|
|
211
|
-
});
|
|
212
|
-
replaceFunction(window, 'setTimeout', function (original) {
|
|
213
|
-
return function wrappedSetTimeout(...args) {
|
|
214
|
-
if (typeof args[0] == 'function') {
|
|
215
|
-
args[0] = makeLoggedFunction(args[0], 'setTimeout callback');
|
|
216
|
-
}
|
|
217
|
-
return original.apply(this, args);
|
|
218
|
-
};
|
|
219
|
-
});
|
|
220
|
-
replaceFunction(window, 'setInterval', function (original) {
|
|
221
|
-
return function wrappedSetInterval(...args) {
|
|
222
|
-
if (typeof args[0] == 'function') {
|
|
223
|
-
args[0] = makeLoggedFunction(args[0], 'setInterval callback');
|
|
224
|
-
}
|
|
225
|
-
return original.apply(this, args);
|
|
226
|
-
};
|
|
227
|
-
});
|
|
228
|
-
const ETp = (window.EventTarget && window.EventTarget.prototype) ||
|
|
229
|
-
window.Node.prototype;
|
|
230
|
-
replaceFunction(ETp, 'addEventListener', function (original) {
|
|
231
|
-
return function wrappedAddEventListener(...args) {
|
|
232
|
-
if (typeof args[1] == 'function') {
|
|
233
|
-
try {
|
|
234
|
-
// If we've made a logger for this function before, use it again,
|
|
235
|
-
// otherwise attach it as a property to the original function.
|
|
236
|
-
// This is necessary so that removeEventListener is called with
|
|
237
|
-
// the right function.
|
|
238
|
-
let loggedFn = args[1].__inboxsdk_logged;
|
|
239
|
-
if (!loggedFn) {
|
|
240
|
-
loggedFn = makeLoggedFunction(args[1], 'event listener');
|
|
241
|
-
args[1].__inboxsdk_logged = loggedFn;
|
|
242
|
-
}
|
|
243
|
-
args[1] = loggedFn;
|
|
244
|
-
}
|
|
245
|
-
catch (e) {
|
|
246
|
-
// This could be triggered if the given function was immutable
|
|
247
|
-
// and stopped us from saving the logged copy on it.
|
|
248
|
-
console.error('Failed to error wrap function', e);
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
return original.apply(this, args);
|
|
252
|
-
};
|
|
253
|
-
});
|
|
254
|
-
replaceFunction(ETp, 'removeEventListener', function (original) {
|
|
255
|
-
return function wrappedRemoveEventListener(...args) {
|
|
256
|
-
if (typeof args[1] == 'function' && args[1].__inboxsdk_logged) {
|
|
257
|
-
args[1] = args[1].__inboxsdk_logged;
|
|
258
|
-
}
|
|
259
|
-
return original.apply(this, args);
|
|
260
|
-
};
|
|
261
|
-
});
|
|
262
|
-
replaceFunction(window, 'MutationObserver', function (Original) {
|
|
263
|
-
Original = Original || window.WebKitMutationObserver;
|
|
264
|
-
function WrappedMutationObserver(...args) {
|
|
265
|
-
if (typeof args[0] == 'function') {
|
|
266
|
-
args[0] = makeLoggedFunction(args[0], 'MutationObserver callback');
|
|
267
|
-
}
|
|
268
|
-
if (Original.bind && Original.bind.apply) {
|
|
269
|
-
// call constructor with variable number of arguments
|
|
270
|
-
return new (Original.bind.apply(Original, [null].concat(args)))();
|
|
271
|
-
}
|
|
272
|
-
else {
|
|
273
|
-
// Safari's MutationObserver lacks a bind method, but its constructor
|
|
274
|
-
// doesn't support extra arguments anyway, so don't bother logging an
|
|
275
|
-
// error here.
|
|
276
|
-
return new Original(args[0]);
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
// Just in case someone wants to monkey-patch the prototype.
|
|
280
|
-
WrappedMutationObserver.prototype = Original.prototype;
|
|
281
|
-
return WrappedMutationObserver;
|
|
282
|
-
});
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
function getAppIdsProperty(causedByAppId, onlyExtensionApps = true) {
|
|
286
|
-
const appIds = onlyExtensionApps ? _extensionAppIds : getAllAppIds();
|
|
287
|
-
if (!causedByAppId) {
|
|
288
|
-
return appIds;
|
|
289
|
-
}
|
|
290
|
-
else {
|
|
291
|
-
const appIdsWithCause = appIds.slice();
|
|
292
|
-
let hasSetCause = false;
|
|
293
|
-
appIdsWithCause.forEach((entry, i) => {
|
|
294
|
-
if (!hasSetCause && entry.appId === causedByAppId) {
|
|
295
|
-
hasSetCause = true;
|
|
296
|
-
appIdsWithCause[i] = { ...entry, causedBy: true };
|
|
297
|
-
}
|
|
298
|
-
Object.freeze(appIdsWithCause[i]);
|
|
299
|
-
});
|
|
300
|
-
return Object.freeze(appIdsWithCause);
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
// err should be an Error instance, and details can be any JSON-ifiable value.
|
|
304
|
-
function _logError(err, details, appId, sentByApp) {
|
|
305
|
-
logError(err, details, {
|
|
306
|
-
appId,
|
|
307
|
-
sentByApp,
|
|
308
|
-
appIds: getAppIdsProperty(appId),
|
|
309
|
-
loaderVersion: _extensionLoaderVersion,
|
|
310
|
-
implVersion: _extensionImplVersion,
|
|
311
|
-
userEmailHash: _extensionUserEmailHash,
|
|
312
|
-
isUsingSyncAPI: _isUsingSyncAPI,
|
|
313
|
-
});
|
|
314
|
-
}
|
|
315
|
-
function makeLoggedFunction(func, name) {
|
|
316
|
-
const msg = name ? 'Uncaught error in ' + name : 'Uncaught error';
|
|
317
|
-
return function (...args) {
|
|
318
|
-
return Logger.run(() => func.apply(this, args), msg);
|
|
319
|
-
};
|
|
320
|
-
}
|
|
321
|
-
function replaceFunction(parent, name, newFnMaker) {
|
|
322
|
-
const newFn = newFnMaker(parent[name]);
|
|
323
|
-
newFn.__original = parent[name];
|
|
324
|
-
parent[name] = newFn;
|
|
325
|
-
}
|
|
326
|
-
export function hashEmail(str) {
|
|
327
|
-
const hasher = new Sha256();
|
|
328
|
-
hasher.update('inboxsdk:' + str);
|
|
329
|
-
return hasher.digest('hex');
|
|
330
|
-
}
|
|
331
|
-
function _trackEvent(appId, type, eventName, properties) {
|
|
332
|
-
if (properties && typeof properties != 'object') {
|
|
333
|
-
throw new Error('properties must be object or null: ' + properties);
|
|
334
|
-
}
|
|
335
|
-
const event = {
|
|
336
|
-
type: type,
|
|
337
|
-
event: eventName,
|
|
338
|
-
timestamp: Date.now() * 1000,
|
|
339
|
-
origin: document.location.origin,
|
|
340
|
-
sessionId: _sessionId,
|
|
341
|
-
emailHash: _extensionUserEmailHash,
|
|
342
|
-
loaderVersion: _extensionLoaderVersion,
|
|
343
|
-
implementationVersion: _extensionImplVersion,
|
|
344
|
-
isUsingSyncAPI: _isUsingSyncAPI,
|
|
345
|
-
properties: properties,
|
|
346
|
-
};
|
|
347
|
-
if (type != 'gmail') {
|
|
348
|
-
Object.assign(event, {
|
|
349
|
-
extensionId: getExtensionId(),
|
|
350
|
-
appIds: getAppIdsProperty(appId),
|
|
351
|
-
});
|
|
352
|
-
}
|
|
353
|
-
else {
|
|
354
|
-
Object.assign(event, {
|
|
355
|
-
appIds: getAppIdsProperty(null, false),
|
|
356
|
-
});
|
|
357
|
-
}
|
|
358
|
-
if (typeof document === 'undefined') {
|
|
359
|
-
return;
|
|
360
|
-
}
|
|
361
|
-
_trackedEventsQueue.add(event);
|
|
362
|
-
// Signal to the logger master that a new event is ready to be sent.
|
|
363
|
-
document.documentElement.setAttribute('data-inboxsdk-last-event', '' + Date.now());
|
|
364
|
-
}
|
|
365
|
-
let currentAccessToken = null;
|
|
366
|
-
function isTimestampExpired(n) {
|
|
367
|
-
// Let's refresh the token 10 minutes early
|
|
368
|
-
return Date.now() + 10 * 60 * 1000 > n;
|
|
369
|
-
}
|
|
370
|
-
async function retrieveNewEventsAccessToken() {
|
|
371
|
-
const { text } = await ajax({
|
|
372
|
-
url: 'https://api.inboxsdk.com/api/v2/events/oauth',
|
|
373
|
-
// Work around CORB for extensions that have permissions to inboxsdk.com
|
|
374
|
-
XMLHttpRequest: getXMLHttpRequest(),
|
|
375
|
-
});
|
|
376
|
-
const accessToken = JSON.parse(text);
|
|
377
|
-
if (isTimestampExpired(accessToken.expirationDate)) {
|
|
378
|
-
console.warn('Got an apparently already expired token. Assuming our clock is busted...');
|
|
379
|
-
// Let's assume the token expires in 30 minutes. The server refreshes the
|
|
380
|
-
// token 30 minutes before it expires so it's probably a safe bet.
|
|
381
|
-
accessToken.expirationDate = Date.now() + 30 * 60 * 1000;
|
|
382
|
-
}
|
|
383
|
-
return accessToken;
|
|
384
|
-
}
|
|
385
|
-
async function getEventsAccessToken() {
|
|
386
|
-
const t = currentAccessToken;
|
|
387
|
-
if (t && !isTimestampExpired(t.expirationDate)) {
|
|
388
|
-
return t;
|
|
389
|
-
}
|
|
390
|
-
else {
|
|
391
|
-
currentAccessToken = await retrieveNewEventsAccessToken();
|
|
392
|
-
return currentAccessToken;
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
if (_extensionIsLoggerMaster &&
|
|
396
|
-
typeof document !== 'undefined' &&
|
|
397
|
-
typeof MutationObserver !== 'undefined') {
|
|
398
|
-
makeMutationObserverStream(document.documentElement, {
|
|
399
|
-
attributes: true,
|
|
400
|
-
attributeFilter: ['data-inboxsdk-last-event'],
|
|
401
|
-
})
|
|
402
|
-
.map(() => null)
|
|
403
|
-
.throttle(120 * 1000)
|
|
404
|
-
.onValue(function () {
|
|
405
|
-
const events = _trackedEventsQueue.removeAll();
|
|
406
|
-
// The trackedEventsQueue is in localStorage, which is shared between
|
|
407
|
-
// multiple tabs. A different tab could have flushed it already recently.
|
|
408
|
-
if (events.length === 0) {
|
|
409
|
-
return;
|
|
410
|
-
}
|
|
411
|
-
(async function () {
|
|
412
|
-
const { oauthToken } = await getEventsAccessToken();
|
|
413
|
-
const apiKey = 'AIzaSyAwlvUR2x3OnCeas8hW8NDzVMswL5hZGg8';
|
|
414
|
-
// TODO change to use CommonPageCommunicator.pageAjax()
|
|
415
|
-
await ajax({
|
|
416
|
-
url: `https://pubsub.googleapis.com/v1/projects/mailfoogae/topics/events:publish?key=${encodeURIComponent(apiKey)}`,
|
|
417
|
-
method: 'POST',
|
|
418
|
-
headers: {
|
|
419
|
-
Authorization: `Bearer ${oauthToken}`,
|
|
420
|
-
'Content-Type': 'application/json',
|
|
421
|
-
},
|
|
422
|
-
data: JSON.stringify({
|
|
423
|
-
messages: [
|
|
424
|
-
{
|
|
425
|
-
data: Buffer.from(JSON.stringify({
|
|
426
|
-
data: events,
|
|
427
|
-
timestamp: Date.now() * 1000,
|
|
428
|
-
})).toString('base64'),
|
|
429
|
-
},
|
|
430
|
-
],
|
|
431
|
-
}),
|
|
432
|
-
});
|
|
433
|
-
})().catch((err) => {
|
|
434
|
-
Logger.error(err, {
|
|
435
|
-
type: 'Failed to log events',
|
|
436
|
-
});
|
|
437
|
-
});
|
|
438
|
-
});
|
|
439
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import zip from 'lodash/zip';
|
|
2
|
-
export default function parseParamsFromRouteID(routeID, hash) {
|
|
3
|
-
const params = Object.create(null);
|
|
4
|
-
zip(routeID.split('/'), hash.split('/')).forEach(([routePart, hashPart]) => {
|
|
5
|
-
if (routePart[0] === ':') {
|
|
6
|
-
params[routePart.slice(1)] = decodeURIComponent(hashPart.replace(/\+/g, ' '));
|
|
7
|
-
}
|
|
8
|
-
});
|
|
9
|
-
return Object.freeze(params);
|
|
10
|
-
}
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
// Queue which tries to persist its data into localStorage so its contents
|
|
2
|
-
// aren't wiped when the page is closed. It handles localStorage not being
|
|
3
|
-
// present or not working (such as if we're running into quota issues).
|
|
4
|
-
// Safe for use in multiple tabs on the same domain at once.
|
|
5
|
-
export default class PersistentQueue {
|
|
6
|
-
_fallbackQueue = [];
|
|
7
|
-
_sid;
|
|
8
|
-
constructor(id) {
|
|
9
|
-
this._sid = 'inboxsdk__persistentqueue_' + id;
|
|
10
|
-
}
|
|
11
|
-
_getSavedQueue() {
|
|
12
|
-
let queue = JSON.parse(localStorage.getItem(this._sid));
|
|
13
|
-
if (queue == null) {
|
|
14
|
-
queue = [];
|
|
15
|
-
}
|
|
16
|
-
return queue;
|
|
17
|
-
}
|
|
18
|
-
_putSavedQueue(queue) {
|
|
19
|
-
localStorage.setItem(this._sid, JSON.stringify(queue));
|
|
20
|
-
}
|
|
21
|
-
_clearSavedQueue() {
|
|
22
|
-
localStorage.removeItem(this._sid);
|
|
23
|
-
}
|
|
24
|
-
add(val) {
|
|
25
|
-
let success = false;
|
|
26
|
-
if (typeof localStorage !== 'undefined') {
|
|
27
|
-
try {
|
|
28
|
-
const queue = this._getSavedQueue();
|
|
29
|
-
queue.push(val);
|
|
30
|
-
this._putSavedQueue(queue);
|
|
31
|
-
success = true;
|
|
32
|
-
}
|
|
33
|
-
catch (e) {
|
|
34
|
-
// ignore
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
if (!success) {
|
|
38
|
-
this._fallbackQueue.push(val);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
remove() {
|
|
42
|
-
let ret;
|
|
43
|
-
if (typeof localStorage !== 'undefined') {
|
|
44
|
-
try {
|
|
45
|
-
const queue = this._getSavedQueue();
|
|
46
|
-
const tmpRet = queue.shift();
|
|
47
|
-
this._putSavedQueue(queue);
|
|
48
|
-
ret = tmpRet;
|
|
49
|
-
}
|
|
50
|
-
catch (e) {
|
|
51
|
-
// ignore
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
// If we didn't get anything from the localStorage queue, or if we
|
|
55
|
-
// failed to update the queue, then try the fallback instead.
|
|
56
|
-
if (ret === undefined) {
|
|
57
|
-
ret = this._fallbackQueue.shift();
|
|
58
|
-
}
|
|
59
|
-
return ret;
|
|
60
|
-
}
|
|
61
|
-
removeAll() {
|
|
62
|
-
let ret = undefined;
|
|
63
|
-
if (typeof localStorage !== 'undefined') {
|
|
64
|
-
try {
|
|
65
|
-
const queue = this._getSavedQueue();
|
|
66
|
-
this._clearSavedQueue();
|
|
67
|
-
ret = queue;
|
|
68
|
-
}
|
|
69
|
-
catch (e) {
|
|
70
|
-
// ignore
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
if (ret === undefined) {
|
|
74
|
-
ret = [];
|
|
75
|
-
}
|
|
76
|
-
ret = ret.concat(this._fallbackQueue);
|
|
77
|
-
this._fallbackQueue = [];
|
|
78
|
-
return ret;
|
|
79
|
-
}
|
|
80
|
-
peekAll() {
|
|
81
|
-
let ret = undefined;
|
|
82
|
-
if (typeof localStorage !== 'undefined') {
|
|
83
|
-
try {
|
|
84
|
-
ret = this._getSavedQueue();
|
|
85
|
-
}
|
|
86
|
-
catch (e) {
|
|
87
|
-
// ignore
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
if (ret === undefined) {
|
|
91
|
-
ret = [];
|
|
92
|
-
}
|
|
93
|
-
ret = ret.concat(this._fallbackQueue);
|
|
94
|
-
return ret;
|
|
95
|
-
}
|
|
96
|
-
clear() {
|
|
97
|
-
if (typeof localStorage !== 'undefined') {
|
|
98
|
-
try {
|
|
99
|
-
this._clearSavedQueue();
|
|
100
|
-
}
|
|
101
|
-
catch (e) {
|
|
102
|
-
// ignore
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
this._fallbackQueue.length = 0;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export default function populateRouteID(routeID, params) {
|
|
2
|
-
const paramsObject = params || {};
|
|
3
|
-
const usedParams = new Set();
|
|
4
|
-
const result = routeID.replace(/:([^/]+)/g, (whole, term) => {
|
|
5
|
-
if (term in paramsObject) {
|
|
6
|
-
usedParams.add(term);
|
|
7
|
-
return encodeURIComponent(String(paramsObject[term]));
|
|
8
|
-
}
|
|
9
|
-
else {
|
|
10
|
-
throw new Error(`Missing param: ${term}`);
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
if (Object.keys(paramsObject).length !== usedParams.size) {
|
|
14
|
-
throw new Error('Extra parameters given');
|
|
15
|
-
}
|
|
16
|
-
return result;
|
|
17
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export default class ElementContainer extends React.Component {
|
|
3
|
-
_content;
|
|
4
|
-
_contentRefCb = (el) => {
|
|
5
|
-
if (el)
|
|
6
|
-
this._content = el;
|
|
7
|
-
};
|
|
8
|
-
componentDidMount() {
|
|
9
|
-
this._content.appendChild(this.props.el);
|
|
10
|
-
}
|
|
11
|
-
componentDidUpdate(prevProps) {
|
|
12
|
-
if (prevProps.el !== this.props.el) {
|
|
13
|
-
while (this._content.lastElementChild) {
|
|
14
|
-
this._content.lastElementChild.remove();
|
|
15
|
-
}
|
|
16
|
-
this._content.appendChild(this.props.el);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
shouldComponentUpdate(nextProps) {
|
|
20
|
-
return (this.props.className !== nextProps.className ||
|
|
21
|
-
this.props.el !== nextProps.el);
|
|
22
|
-
}
|
|
23
|
-
render() {
|
|
24
|
-
return React.createElement("div", { className: this.props.className, ref: this._contentRefCb });
|
|
25
|
-
}
|
|
26
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import memoize from 'lodash/memoize';
|
|
2
|
-
import find from 'lodash/find';
|
|
3
|
-
import escapeRegExp from 'lodash/escapeRegExp';
|
|
4
|
-
const routeIDtoRegExp = memoize((routeID) => new RegExp('^' + escapeRegExp(routeID).replace(/\/:[^/]+/g, '/([^/]+)') + '/?$'));
|
|
5
|
-
export default function routeIDmatchesHash(routeID, hash) {
|
|
6
|
-
const routeIDs = Array.isArray(routeID) ? routeID : [routeID];
|
|
7
|
-
return find(routeIDs, (routeID) => hash.match(routeIDtoRegExp(routeID)));
|
|
8
|
-
}
|