Skip to content

dom tame poc#29056

Closed
weizman wants to merge 13 commits into
mainfrom
weizman/dom-tame-poc
Closed

dom tame poc#29056
weizman wants to merge 13 commits into
mainfrom
weizman/dom-tame-poc

Conversation

@weizman

@weizman weizman commented Dec 10, 2024

Copy link
Copy Markdown
Contributor

works nicely, still needs to tame addEventListener (EventMessage.prototype window leaking props).
test by:

  • yarn dist
  • lookup document.createElement("div"); under the entire dist/chrome folder
  • pick the one within common-1.js (should have the string "50px" right after it)
  • paste the following code right after it
  • visit the extension with your devtools open
;(function test1(){ debugger;
    try {
        document.createElement('a').ownerDocument.location
    } catch (e) {
        e.message === 'NOT ALLOWED(document): location';
    }
    try {
        document.createElement('a').ownerDocument.open
    } catch (e) {
        e.message === 'NOT ALLOWED(document): open';
    }
    try {
        document.createElement('a').ownerDocument.defaultView.alert
    } catch (e) {
        e.message === 'NOT ALLOWED(window): alert';
    }
    try {
        document.createElement('a').ownerDocument.body.getRootNode() === document.createElement('a').ownerDocument
    } catch {}
    try {
        document.createElement('a').ownerDocument.body.parentNode.parentNode === document.createElement('a').ownerDocument
    } catch {}
}());

@metamaskbot metamaskbot added team-lavamoat INVALID-PR-TEMPLATE PR's body doesn't match template labels Dec 10, 2024
@weizman

weizman commented Dec 11, 2024

Copy link
Copy Markdown
Contributor Author

this works! fc178c0

@metamaskbot

Copy link
Copy Markdown
Collaborator
Builds ready [929f3d9]
Page Load Metrics (1661 ± 41 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1502191316668742
domContentLoaded1489183116347837
load1494191716618541
domInteractive25166393215
backgroundConnect685272110
firstReactRender16105473316
getState499252713
initialActions01000
loadScripts1092140412277235
setupStore589212813
uiStartup172227662029265127
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@weizman

weizman commented Feb 17, 2025

Copy link
Copy Markdown
Contributor Author

this causes one error specifically with LavaDome, which would be fixed once LavaMoat/LavaDome#60 is merged

@weizman

weizman commented Feb 17, 2025

Copy link
Copy Markdown
Contributor Author

proper lavamoat api attempt @ LavaMoat/LavaMoat#1540

@github-actions

github-actions Bot commented Jun 3, 2025

Copy link
Copy Markdown
Contributor

This PR has been automatically marked as stale because it has not had recent activity in the last 90 days. It will be closed in 7 days. Thank you for your contributions.

@github-actions github-actions Bot added the stale issues and PRs marked as stale label Jun 3, 2025
@github-actions

Copy link
Copy Markdown
Contributor

This PR was closed because there has been no follow up activity in 7 days. Thank you for your contributions.

@github-actions github-actions Bot closed this Jun 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

INVALID-PR-TEMPLATE PR's body doesn't match template stale issues and PRs marked as stale team-lavamoat

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants