blackboxing.js (737B)
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 module.exports = { 8 async addOrSetSessionDataEntry( 9 targetActor, 10 entries, 11 isDocumentCreation, 12 updateType 13 ) { 14 const { sourcesManager } = targetActor; 15 if (updateType == "set") { 16 sourcesManager.clearAllBlackBoxing(); 17 } 18 for (const { url, range } of entries) { 19 sourcesManager.blackBox(url, range); 20 } 21 }, 22 23 removeSessionDataEntry(targetActor, entries) { 24 for (const { url, range } of entries) { 25 targetActor.sourcesManager.unblackBox(url, range); 26 } 27 }, 28 };