tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

microsoftOfficeAuth.js (918B)


      1 /* This Source Code Form is subject to the terms of the Mozilla Public
      2 * License, v. 2.0. If a copy of the MPL was not distributed with this
      3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      4 
      5 "use strict";
      6 
      7 /**
      8 * Bug 1747889 - Microsoft Office Auth
      9 *
     10 * The Microsoft Office auth iframe is missing the sandbox attribute
     11 * 'allow-storage-access-by-user-activation'. This shim adds the attribute to
     12 * the iframe.
     13 */
     14 
     15 const SANDBOX_ATTR = "allow-storage-access-by-user-activation";
     16 
     17 // Watches for MS auth iframes and adds missing sandbox attribute.
     18 function init() {
     19  const observer = new MutationObserver(() => {
     20    document.body.querySelectorAll("#SharedAuthFrame").forEach(frame => {
     21      frame.sandbox.add(SANDBOX_ATTR);
     22    });
     23  });
     24 
     25  observer.observe(document.body, {
     26    attributes: true,
     27    subtree: false,
     28    childList: true,
     29  });
     30 }
     31 window.addEventListener("DOMContentLoaded", init);