1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 11:22:43 +02:00
metamask-extension/app/scripts/lib
Ariella Vu a87c1750b0
MV3: Update service worker restart logic and keep-alive logic for dapp support (#16075)
* dapp: add debug statements

* dapp: add retry logic [debug]

* dapp: keep SW alive on rpc request

* Revert "dapp: add debug statements"

This reverts commit ea21786f7f66c712eea02405cd68fe925d227ffa.

* dapp: try to set up ext streams asap on reset

* dapp: apply keep alive logic to phishingPageStream

* dapp:put keep-alive logic behind isManifestV3 flag

* Re-activate streams after a period of service worker in-activity

* dapp: rm extra function

* dapp: update phishing onDisconnect

* dapp: fix eslint missing global chrome

* add EXTENSION_MESSAGES const

* use EXTENSION_MESSAGES more generic comment

* update comment

* dapp: clean timeout and interval

* Fix DAPP action replay

* execute DAPP action replay for only MV3

* fix

* fix

* fix

* comment out DAPP action replay code

* fix

* fix

* fix

* scripts/background: use browser polyfill

* Revert "scripts/background: use browser polyfill"

This reverts commit 2ab6234d11b3b11e10dd993d454eeaad63bfc886.

* scripts/background: use browser polyfill

* script/background: check lastError

* dapp: use EXTENSION_MESSAGES

* scripts/background: send ready msg to all tabs

* dapp: update onMessage handler comment and name

* dapp: return values onMessage listener
see: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/onMessage#addlistener_syntax

* dapp: mv onMessage listener

* dapp: add onMessage setupPhishingExtStreams

* dapp: rn reset -> destroy streams

* dapp: rn reset -> destroy for phishing streams

* dapp: clean comment

* dapp: rm unused comments
planning to be readded in follow-up PR: #16250

* dapp: onMessage return Promise|undefined

* dapp:clean: add missing undefined return type

* dapp: use new checkForErrorAndLog for Chrome API
handy stackoverflow: https://stackoverflow.com/a/28432087/4053142

* dapp:fix: return tabs.query result

* dapp:eslint: return undefined
fix Expected to return a value at the end of arrow
function.eslintconsistent-return

* background: do not query tabs w/out url

* background: rm Could not establish... catch
- no longer needed after improved tabs query

* dapp:clean: rm unused checkForError... for now...

* dapp: prevent setupExtensionStreams called twice
- calling connect will trigger disconnect and may cause issues
- only setup streams if they are not connected

* dapp: handle onDisconnect lastError
- throwing errors from contentscript will break the dapp, so only warn
- not handling lastError when it's found will also break the dapp

* background: update tabs.query url comment

* background: update tabs.query url comment 2

* dapp: fix SW restart for multi dapp support
- ref: https://stackoverflow.com/a/54686484/4053142

* dapp:clean: rm extra "." from console.warn

* clean: comments for dapp and background

* Adding catch block (#16454)

* fix: FireFox provider injection

* lib/util: fix invalid checkForErrorAndWarn export

* bg: add explanation for tabs.sendMessage catch

* dapp: add browser-runtime.utils

* runtime.utils: add checkForLastErrorAndLog

Co-authored-by: Jyoti Puri <jyotipuri@gmail.com>
Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com>
2022-11-15 00:18:08 +07:00
..
ens-ipfs Deprecating the Rinkeby, Ropsten, and Kovan test networks (#15989) 2022-09-28 20:26:01 -07:00
migrator remove exclusions for mismatched object jsdoc type casing (#15351) 2022-07-27 08:28:05 -05:00
rpc-method-middleware migrate network constants to typescript (#15610) 2022-09-14 09:55:31 -05:00
segment Persisting segment events in MetaMetricsController store (#16198) 2022-11-08 04:33:03 +05:30
account-tracker.js [Bug]: Balance does not update on duplicate chainId network #13690 (#14245) 2022-11-04 11:29:45 -05:00
buy-url.js Deprecating the Rinkeby, Ropsten, and Kovan test networks (#15989) 2022-09-28 20:26:01 -07:00
buy-url.test.js Deprecating the Rinkeby, Ropsten, and Kovan test networks (#15989) 2022-09-28 20:26:01 -07:00
cleanErrorStack.js Add JSDoc ESLint rules (#12112) 2022-01-07 12:27:33 -03:30
cleanErrorStack.test.js Jestify app/scripts/lib/**/*.test.js (#12890) 2021-12-06 10:40:39 -06:00
ComposableObservableStore.js remove exclusions for mismatched object jsdoc type casing (#15351) 2022-07-27 08:28:05 -05:00
ComposableObservableStore.test.js Bump minimum Node.js version to 16 (#15131) 2022-07-02 23:32:18 -07:00
createLoggerMiddleware.js Add JSDoc ESLint rules (#12112) 2022-01-07 12:27:33 -03:30
createMetaRPCHandler.js Persist state in metaRPCHandler so that we are sure state is persisted before sending back response to actions (#15978) 2022-10-10 17:10:44 -05:00
createMetaRPCHandler.test.js Remove nodeify (#13003) 2021-12-08 18:06:53 -03:30
createOnboardingMiddleware.js Deprecate extensionizer for webextension-polyfill (#13960) 2022-03-18 14:07:05 -05:00
createOriginMiddleware.js Add JSDoc ESLint rules (#12112) 2022-01-07 12:27:33 -03:30
createRPCMethodTrackingMiddleware.js Increase provider rate limited to 5 minutes (#16308) 2022-10-31 15:24:01 -02:30
createRPCMethodTrackingMiddleware.test.js Fix Provider Tracking Metrics (#15082) 2022-07-20 08:25:04 -05:00
createStreamSink.js @metamask/eslint config@5.0.0 (#10358) 2021-02-04 10:15:23 -08:00
createTabIdMiddleware.js Add JSDoc ESLint rules (#12112) 2022-01-07 12:27:33 -03:30
decrypt-message-manager.js Bump keystone package versions to latest (#15878) 2022-09-22 10:04:24 -05:00
encryption-public-key-manager.js remove exclusions for mismatched object jsdoc type casing (#15351) 2022-07-27 08:28:05 -05:00
extractEthjsErrorMessage.js Add JSDoc ESLint rules (#12112) 2022-01-07 12:27:33 -03:30
get-first-preferred-lang-code.js ensure that we default users with browser language code 'zh' to the supported 'zh_CN' language code (#16329) 2022-10-31 16:48:51 -05:00
getObjStructure.js remove exclusions for mismatched object jsdoc type casing (#15351) 2022-07-27 08:28:05 -05:00
local-store.js Persist state in metaRPCHandler so that we are sure state is persisted before sending back response to actions (#15978) 2022-10-10 17:10:44 -05:00
local-store.test.js Persist state in metaRPCHandler so that we are sure state is persisted before sending back response to actions (#15978) 2022-10-10 17:10:44 -05:00
message-manager.js remove exclusions for mismatched object jsdoc type casing (#15351) 2022-07-27 08:28:05 -05:00
message-manager.test.js Jestify app/scripts/lib/**/*.test.js (#12890) 2021-12-06 10:40:39 -06:00
metaRPCClientFactory.js Remove related UI code from the app dir (#15384) 2022-09-16 14:05:21 -05:00
metaRPCClientFactory.test.js Fix rpc and tests (#15570) 2022-08-16 18:21:35 +05:30
network-store.js Persist state in metaRPCHandler so that we are sure state is persisted before sending back response to actions (#15978) 2022-10-10 17:10:44 -05:00
notification-manager.js Add JSDoc ESLint rules (#12112) 2022-01-07 12:27:33 -03:30
personal-message-manager.js Bump keystone package versions to latest (#15878) 2022-09-22 10:04:24 -05:00
personal-message-manager.test.js Jestify app/scripts/lib/**/*.test.js (#12890) 2021-12-06 10:40:39 -06:00
seed-phrase-verifier.js Update SRP representation 2022-03-30 21:01:26 -02:30
seed-phrase-verifier.test.js Jestify app/scripts/lib/**/*.test.js (#12890) 2021-12-06 10:40:39 -06:00
sentry-filter-events.ts Fix Sentry deduplication of events that were never sent (#15677) 2022-08-23 16:14:14 -02:30
setupSentry.js Remove 3box feature and delete ThreeBoxController (#14571) 2022-10-31 13:50:50 -02:30
stream-utils.js Fix orphaned data warning (#16413) 2022-11-08 16:38:48 -06:00
typed-message-manager.js update prettier (#15360) 2022-07-31 13:26:40 -05:00
typed-message-manager.test.js Jestify app/scripts/lib/**/*.test.js (#12890) 2021-12-06 10:40:39 -06:00
util.js MV3: Update service worker restart logic and keep-alive logic for dapp support (#16075) 2022-11-15 00:18:08 +07:00
util.test.js Use externally hosted phishing warning page 2022-05-16 14:40:50 -02:30