Merge pull request 'allow top navigation' (#24) from i23 into main

Reviewed-on: https://codeberg.org/macchiato/pages/pulls/24
file-group-page
bat 3 years ago
commit 2a48c53875

@ -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