Skip to content

Commit bbff8b9

Browse files
save file
1 parent 4479060 commit bbff8b9

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

utils/editors/html-editor/html/output-html/v2.0/output-html-v2.0.html

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,24 @@
2626

2727
<div id=hdr>
2828
<span id=allow-scripts class=radio>
29-
<input type=checkbox>
29+
<input type=checkbox checked>
3030
allow-scripts
3131
</span>
32+
<span id=allow-modals class=radio>
33+
<input type=checkbox checked>
34+
allow-modals
35+
</span>
36+
<span id=allow-popups class=radio>
37+
<input type=checkbox checked>
38+
allow-popups
39+
</span>
40+
3241
<div style='flex:1'></div>
3342
<button id=kill style='margin-right:20px'>kill</button>
3443
</div>
3544

3645
<div id=hldr>
37-
<iframe sandbox='allow-scripts allow-forms allow-popups allow-modals allow-downloads allow-pointer-lock allow-same-origin'></iframe>
46+
<iframe sandbox='allow-forms allow-downloads allow-pointer-lock allow-popups-to-escape-sandbox allow-same-origin'></iframe>
3847
<div id=glass></div>
3948
</div>
4049

@@ -95,7 +104,9 @@
95104

96105
var hdr = $(shadow,'#hdr');
97106
chk['allow-scripts'] = $.chkbox(hdr,'#allow-scripts');
98-
console.log(chk);
107+
chk['allow-modals'] = $.chkbox(hdr,'#allow-modals');
108+
chk['allow-popups'] = $.chkbox(hdr,'#allow-popups');
109+
99110
$(hdr,'#kill').onclick = btn.kill;
100111

101112

@@ -149,11 +160,19 @@
149160

150161
var attr = iframe.getAttribute('sandbox');
151162
var tokens = new Set(attr.split(/\s+/).filter(Boolean));
163+
152164
if(chk['allow-scripts'].checked){
153165
tokens.add('allow-scripts');
154166
}
167+
if(chk['allow-modals'].checked){
168+
tokens.add('allow-modals');
169+
}
170+
if(chk['allow-popups'].checked){
171+
tokens.add('allow-popups');
172+
}
173+
155174
var attr = [...tokens].join(' ');
156-
console.log(attr);
175+
console.log(attr);
157176
iframe.setAttribute('sandbox',attr);
158177

159178
iframe.srcdoc = html;

0 commit comments

Comments
 (0)