-
-
Notifications
You must be signed in to change notification settings - Fork 368
IGNORE: cursed iframe test #416
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| <body style="margin:0px;padding:0px;overflow:hidden"> | ||
| iFrame | ||
| <iframe src="index.html" frameborder="0" style="overflow:hidden;height:100%;width:100%" height="100%" width="100%"></iframe> | ||
| </body> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -272,7 +272,18 @@ | |
| } | ||
|
|
||
| const detectEip6963 = () => { | ||
| window.addEventListener('eip6963:announceProvider', (event) => { | ||
| // Modify here | ||
| const currentNetworkName = document.getElementById('hello'); | ||
| currentNetworkName.textContent = JSON.stringify(!window.ethereum && Boolean(window.parent.ethereum)); | ||
|
Check failure on line 277 in src/index.js
|
||
| setTimeout(async () => { | ||
| try { | ||
| currentNetworkName.textContent = await window.parent.ethereum.request({method: 'eth_requestAccounts'}) | ||
|
Check failure on line 280 in src/index.js
|
||
| } catch (error) { | ||
| currentNetworkName.textContent = error.message; | ||
| } | ||
| }, 5000); | ||
|
|
||
| window.parent.addEventListener('eip6963:announceProvider', (event) => { | ||
| if (event.detail.info.uuid) { | ||
| eip6963Warning.hidden = true; | ||
| eip6963Section.hidden = false; | ||
|
|
@@ -281,7 +292,7 @@ | |
| } | ||
| }); | ||
|
|
||
| window.dispatchEvent(new Event('eip6963:requestProvider')); | ||
| window.parent.dispatchEvent(new Event('eip6963:requestProvider')); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Iframe Detection Alters UI and EIP-6963 BehaviorDebugging code was accidentally committed, adding "IsIabIframe:" text and dynamic iframe detection results to the UI's accounts section. This also modifies the Additional Locations (1) |
||
| }; | ||
|
|
||
| export const setActiveProviderDetail = async (providerDetail) => { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Inconsistent Error Handling in Ethereum Access
Directly accessing
window.parent.ethereumlacks error handling, which can lead to issues like cross-origin errors in iframes or ifwindow.parent.ethereumis undefined. This is inconsistent with thetry-catchblock used in the subsequentsetTimeoutcall.