Skip to content

Commit

Permalink
auto about:blank
Browse files Browse the repository at this point in the history
  • Loading branch information
proudparrot2 committed Feb 20, 2024
1 parent 05b1874 commit ead0478
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ window.document.documentElement.classList.add('dark')
export default function App() {
useEffect(() => {
registerDefaultPlugins()
// handleNewPlugins()
}, [])

return (
Expand Down
17 changes: 14 additions & 3 deletions src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
import ReactDOM from 'react-dom/client'
import App from './App.tsx'

ReactDOM.createRoot(document.getElementById('root')!).render(
<App />
)
if (!window.frameElement) {
const tab = window.open('about:blank', '_blank')
const iframe = tab!.document.createElement('iframe')
const stl = iframe!.style
stl.border = stl.outline = 'none'
stl.width = '100vw'
stl.height = '100vh'
stl.position = 'fixed'
stl.left = stl.right = stl.top = stl.bottom = '0'
iframe!.src = self.location.href
tab!.document.body.appendChild(iframe!)
}

ReactDOM.createRoot(document.getElementById('root')!).render(<App />)

0 comments on commit ead0478

Please sign in to comment.