isolation.js 584 B

1234567891011121314151617
  1. // Copyright 2019-2024 Tauri Programme within The Commons Conservancy
  2. // SPDX-License-Identifier: Apache-2.0
  3. // SPDX-License-Identifier: MIT
  4. if (location.href !== __TEMPLATE_isolation_src__) {
  5. window.addEventListener('DOMContentLoaded', () => {
  6. let style = document.createElement('style')
  7. style.textContent = __TEMPLATE_style__
  8. document.head.append(style)
  9. let iframe = document.createElement('iframe')
  10. iframe.id = '__tauri_isolation__'
  11. iframe.sandbox.add('allow-scripts')
  12. iframe.src = __TEMPLATE_isolation_src__
  13. document.body.append(iframe)
  14. })
  15. }