clearDataForSite.js (911B)
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 file, 3 * You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 "use strict"; 6 7 let lazy = {}; 8 ChromeUtils.defineESModuleGetters(lazy, { 9 ForgetAboutSite: "resource://gre/modules/ForgetAboutSite.sys.mjs", 10 }); 11 12 window.addEventListener("load", () => { 13 let retVals = window.arguments[0]; 14 15 document.addEventListener("dialogaccept", e => { 16 e.preventDefault(); 17 lazy.ForgetAboutSite.removeDataFromBaseDomain(retVals.host).catch( 18 console.error 19 ); 20 window.close(); 21 }); 22 23 document.addEventListener("dialogcancel", e => { 24 e.preventDefault(); 25 window.close(); 26 }); 27 28 document.l10n.setAttributes( 29 document.getElementById("clear-data-for-site-list"), 30 "clear-data-for-site-list", 31 { 32 site: retVals.hostOrBaseDomain, 33 } 34 ); 35 });