1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 01:47:00 +01:00
metamask-extension/shared/modules
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
..
browser-runtime.utils.js MV3: Update service worker restart logic and keep-alive logic for dapp support (#16075) 2022-11-15 00:18:08 +07:00
buffer-utils.js Add JSDoc ESLint rules (#12112) 2022-01-07 12:27:33 -03:30
buffer-utils.test.js Using expect in jest unit tests under /shared (#11413) 2021-06-29 10:50:18 -07:00
contract-utils.js Refactor checking if address is contract into a new module. (#12354) 2021-10-20 16:12:07 +01:00
contract-utils.test.js update prettier (#15360) 2022-07-31 13:26:40 -05:00
conversion.utils.js Bump keystone package versions to latest (#15878) 2022-09-22 10:04:24 -05:00
conversion.utils.test.js EIP-1559 V2 : Advanced gas fee modal - Max base fee and Priority fee inputs (#12619) 2021-11-29 23:10:48 +05:30
fetch-with-timeout.js Set default getFetchWithTimeout default timeout value (#14218) 2022-07-19 11:13:45 -05:00
fetch-with-timeout.test.js Set default getFetchWithTimeout default timeout value (#14218) 2022-07-19 11:13:45 -05:00
gas.utils.js Add JSDoc ESLint rules (#12112) 2022-01-07 12:27:33 -03:30
gas.utils.test.js Add gas utils shared module (#11452) 2021-07-07 11:13:40 -05:00
hexstring-utils.js Bump keystone package versions to latest (#15878) 2022-09-22 10:04:24 -05:00
hexstring-utils.test.js Format shared/modules/*.tests to use jest arrow functions and use stricter comparative matcher (#12908) 2021-11-30 12:09:46 -06:00
mv3.utils.js Refactoring isManifestV3 variable (#15568) 2022-08-16 20:51:42 +05:30
network.utils.js migrate network constants to typescript (#15610) 2022-09-14 09:55:31 -05:00
object.utils.js remove exclusions for mismatched object jsdoc type casing (#15351) 2022-07-27 08:28:05 -05:00
provider-injection.js Remove docs.google.com from blocked domains list (#16154) 2022-10-11 07:56:03 -07:00
random-id.js fix: replace dnode background with JSON-RPC (#10627) 2021-03-18 11:23:46 -07:00
rpc.utils.js Set default getFetchWithTimeout default timeout value (#14218) 2022-07-19 11:13:45 -05:00
siwe.js Bump keystone package versions to latest (#15878) 2022-09-22 10:04:24 -05:00
string-utils.js 3box Replacement (#15243) 2022-08-09 19:36:32 +01:00
swaps.utils.js Swaps support for local testnet (#10658) 2021-03-18 07:50:06 -02:30
transaction.utils.js Make addUnapprovedTransaction action idempotent (#15667) 2022-09-06 14:38:32 +05:30
transaction.utils.test.js update prettier (#15360) 2022-07-31 13:26:40 -05:00