Ver Fonte

change live snapshot preview iframe sandbox rules

Nick Sweeting há 1 ano atrás
pai
commit
e4176dbf7a
1 ficheiros alterados com 2 adições e 2 exclusões
  1. 2 2
      archivebox/templates/core/snapshot_live.html

+ 2 - 2
archivebox/templates/core/snapshot_live.html

@@ -405,7 +405,7 @@
                                     </a>
                                     </a>
                                     <!--<a href="{{result.path}}" target="preview"><h4 class="card-title">{{result.name}}</h4></a>-->
                                     <!--<a href="{{result.path}}" target="preview"><h4 class="card-title">{{result.name}}</h4></a>-->
                                 </div>
                                 </div>
-                                <iframe class="card-img-top" src="{{result.path}}" sandbox="allow-scripts allow-forms" scrolling="no" loading="lazy"></iframe>
+                                <iframe class="card-img-top" src="{{result.path}}" sandbox="allow-same-origin allow-top-navigation-by-user-activation allow-scripts allow-forms" scrolling="no" loading="lazy"></iframe>
                             </div>
                             </div>
                         </div>
                         </div>
                     {% endfor %}
                     {% endfor %}
@@ -463,7 +463,7 @@
                     if (target.endsWith('.pdf')) {
                     if (target.endsWith('.pdf')) {
                         jQuery('#main-frame')[0].removeAttribute('sandbox')
                         jQuery('#main-frame')[0].removeAttribute('sandbox')
                     } else {
                     } else {
-                        jQuery('#main-frame')[0].sandbox = "allow-scripts allow-forms allow-top-navigation-by-user-activation"
+                        jQuery('#main-frame')[0].sandbox = "allow-same-origin allow-top-navigation-by-user-activation allow-scripts allow-forms"
                     }
                     }
                     window.location.hash = getPreviewTypeFromPath(event.currentTarget.querySelector('a'))
                     window.location.hash = getPreviewTypeFromPath(event.currentTarget.querySelector('a'))