We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
[DOM intrusion] Hide visible elements containing sensitive data from browser extensions
<shadow-container>
<template><my-app></my-app><live-localizer></live-localizer></template>
<template>
diff --git a/demo/cache-automation.js b/demo/cache-automation.js index fe224cc6..c766e908 100644 --- a/demo/cache-automation.js +++ b/demo/cache-automation.js @@ -15,7 +15,7 @@ async function automationFunction() { reject(new Error('timeout for bundle-set-fetched')); } try { - let model = document.querySelector('live-localizer').shadowRoot + let model = document.querySelector('shadow-container')._shadowRoot.querySelector('live-localizer').shadowRoot .getElementById('main').shadowRoot .getElementById('dialog') .querySelector('live-localizer-panel').shadowRoot @@ -39,7 +39,7 @@ async function automationFunction() { await new Promise(async (resolve, reject) => { try { - let menuItems = document.querySelector('my-app').shadowRoot + let menuItems = document.querySelector('shadow-container')._shadowRoot.querySelector('my-app').shadowRoot .children[3] // app-drawer-layout .querySelector('app-drawer') .querySelector('iron-selector') diff --git a/demo/mark-parsed.js b/demo/mark-parsed.js index 35fa9cd8..7bcf0287 100644 --- a/demo/mark-parsed.js +++ b/demo/mark-parsed.js @@ -14,4 +14,19 @@ Copyright (c) 2020, Tetsuya Mori <t2y3141592@gmail.com>. All rights reserved. if (self.frameElement) { frameElement.dispatchEvent(new Event('srcdoc-load')) } + class ShadowContainer extends HTMLElement { + constructor() { + super(); + this._shadowRoot = this.attachShadow({ mode: "closed" }); + } + connectedCallback() { + if (!this._appended) { + [...this.querySelector('template').content.childNodes] + //.filter(child => !(child.tagName === 'SCRIPT' && child.src.indexOf('/hook.min.js?') >= 0)) + .forEach(child => this._shadowRoot.appendChild(child)); + this._appended = true; + } + } + } + customElements.define('shadow-container', ShadowContainer); } diff --git a/demo/original-index.html b/demo/original-index.html index b8e18a58..5dd643a4 100644 --- a/demo/original-index.html +++ b/demo/original-index.html @@ -579,7 +579,7 @@ Copyright (c) 2017, 2018, Tetsuya Mori <t2y3141592@gmail.com>. All rights reserv </head> <body> - + <shadow-container><template> <my-app></my-app> <live-localizer> @@ -607,6 +607,7 @@ Copyright (c) 2017, 2018, Tetsuya Mori <t2y3141592@gmail.com>. All rights reserv api-key="AIzaSyCjrlPhl0cLSZVRsDvuajq16vkerhcu_UM"> </live-localizer-firebase-storage> </live-localizer> + </template></shadow-container> <script src="mark-parsed.js?no-hook=true"></script> </body> </html>
The text was updated successfully, but these errors were encountered:
No branches or pull requests
[DOM intrusion] Hide visible elements containing sensitive data from browser extensions
Status - In an early stage of researching
Feature
Current Experimental Implementation
<shadow-container>
web component to contain application elements<shadow-container>
has a CLOSED Shadow DOM, which is INACCESSIBLE FROM BROWSER EXTENSIONS<shadow-container>
contains<template><my-app></my-app><live-localizer></live-localizer></template>
<shadow-container>
moves elements in the<template>
to the closed shadow DOMNotes
The text was updated successfully, but these errors were encountered: