author Santo Pfingsten
 *  see https import { BrowsingData } from "webextension-polyfill-ts" ; import { Cleaner } from "./cleaner" ; import { TabWatcher } from "../tabWatcher" ; import { settings } from "../../lib/settings" ; export class TemporaryRuleCleaner extends Cleaner { private readonly tabWatcher : TabWatcher ; public constructor ( tabWatcher ) { super ( ) ; this . tabWatcher = tabWatcher ; } public clean ( typeSet , startup ) { } public cleanDomainOnLeave ( storeId , domain ) { const temporaryRules = settings . getTemporaryRules ( ) ; const rulesToRemove = temporaryRules . filter ( ( rule ) => ! this . tabWatcher . containsRuleFP ( rule . regex ) ) . map ( ( rule ) => rule . definition . rule ) ; if ( rulesToRemove . length ) settings . removeRules ( rulesToRemove ) ; } }