|
35 | 35 | <input type=checkbox checked> |
36 | 36 | allow-modals |
37 | 37 | </span> |
38 | | - <span id=allow-popups class=radio> |
| 38 | + <span id=allow-popups class=radio style='margin-right:30px'> |
39 | 39 | <input type=checkbox checked> |
40 | 40 | allow-popups |
41 | 41 | </span> |
| 42 | + <span id=isolate class=radio> |
| 43 | + <input type=checkbox checked> |
| 44 | + isolate |
| 45 | + </span> |
42 | 46 |
|
43 | 47 | <div style='flex:1'></div> |
44 | 48 |
|
|
116 | 120 | var glass; |
117 | 121 |
|
118 | 122 |
|
119 | | - var btn = {}; |
120 | | - obj.on = {}; |
| 123 | + var sandbox_url; |
| 124 | + |
| 125 | + |
| 126 | + var btn = {}; |
| 127 | + btn.console = {}; |
| 128 | + obj.on = {}; |
121 | 129 |
|
122 | 130 |
|
123 | 131 | //: |
|
136 | 144 | //: |
137 | 145 |
|
138 | 146 |
|
139 | | - obj.initdom = function(rootnode){ |
| 147 | + obj.initdom = function(){ |
140 | 148 |
|
141 | 149 | shadow = host.shadowRoot; |
142 | 150 |
|
|
149 | 157 | chk['allow-scripts'] = $.chkbox(hdr,'#allow-scripts'); |
150 | 158 | chk['allow-modals'] = $.chkbox(hdr,'#allow-modals'); |
151 | 159 | chk['allow-popups'] = $.chkbox(hdr,'#allow-popups'); |
| 160 | + chk['isolate'] = $.chkbox(hdr,'#isolate',btn.isolate); |
152 | 161 |
|
153 | | - chk['console-show'] = $.chkbox(hdr,'#console-show',btn.show_console); |
| 162 | + chk['console-show'] = $.chkbox(hdr,'#console-show',btn.console.show); |
154 | 163 | chk['console-echo'] = $.chkbox(hdr,'#console-echo'); |
155 | 164 | chk['console-persist'] = $.chkbox(hdr,'#console-persist'); |
156 | | - $(shadow,'#console-clear').onclick = btn.clear_console; |
| 165 | + $(shadow,'#console-clear').onclick = btn.console.clear; |
157 | 166 |
|
158 | 167 | $(hdr,'#kill').onclick = btn.kill; |
159 | 168 |
|
160 | 169 |
|
161 | 170 | hldr = $(shadow,'#hldr'); |
162 | 171 | iframe = $(shadow,'iframe'); |
163 | 172 | def_sandbox = iframe.getAttribute('sandbox'); |
| 173 | + sandbox_url = iframe.src; |
164 | 174 | glass = $(shadow,'#glass'); |
165 | 175 |
|
166 | 176 |
|
|
177 | 187 | }//kill |
178 | 188 |
|
179 | 189 |
|
180 | | - btn.show_console = function(chk){ |
| 190 | + btn.isolate = function(chk){ |
| 191 | + |
| 192 | + var url = new URL(sandbox_url); |
| 193 | + if(chk.checked){ |
| 194 | + sanbox_url += '?isolate'; |
| 195 | + }else{ |
| 196 | + var i = sandbox_url.indexOf('?'); |
| 197 | + sandbox_url = sandbox_url.slice(0,i); |
| 198 | + } |
| 199 | + |
| 200 | + }//isolate |
| 201 | + |
| 202 | + |
| 203 | + btn.console.show = function(chk){ |
181 | 204 |
|
182 | 205 | if(chk.checked){ |
183 | 206 | webconsole.host.style.display = ''; |
184 | 207 | }else{ |
185 | 208 | webconsole.host.style.display = 'none'; |
186 | 209 | } |
187 | 210 |
|
188 | | - }//show_console |
| 211 | + }//show |
189 | 212 |
|
190 | 213 |
|
191 | | - btn.clear_console = function(){ |
| 214 | + btn.console.clear = function(){ |
192 | 215 |
|
193 | 216 | webconsole.clear(); |
194 | 217 | if(chk['console-echo'].checked){ |
195 | 218 | console.clear(); |
196 | 219 | } |
197 | 220 |
|
198 | | - }//clear_console |
| 221 | + }//clear |
| 222 | + |
199 | 223 |
|
200 | 224 |
|
201 | 225 | obj.glass = function(show=true){ |
|
0 commit comments