allow top navigation

file-group-page
bat 3 years ago
parent 423938d88c
commit 8dbb14b9b3

@ -16,7 +16,7 @@ const frameHtml = `<!doctype html>
</style> </style>
</head> </head>
<body> <body>
<iframe srcdoc="" sandbox="allow-scripts"></iframe> <iframe srcdoc="" sandbox="allow-scripts allow-top-navigation"></iframe>
${'<'}script type="module"> ${'<'}script type="module">
const frame = document.getElementsByTagName('iframe')[0] const frame = document.getElementsByTagName('iframe')[0]
addEventListener('message', event => { addEventListener('message', event => {
@ -90,7 +90,7 @@ export class Page extends HTMLElement {
this.shadowRoot.appendChild(wrap) this.shadowRoot.appendChild(wrap)
const tmp = document.createElement('iframe') const tmp = document.createElement('iframe')
if (this.csp !== undefined) { if (this.csp !== undefined) {
tmp.sandbox = "allow-same-origin allow-scripts" tmp.sandbox = "allow-same-origin allow-scripts allow-top-navigation"
const url = new URL( const url = new URL(
'/-/frame', location.href '/-/frame', location.href
) )

Loading…
Cancel
Save