author Santo Pfingsten
 *  see https import { browser , WebRequest } from "webextension-polyfill-ts" ; import { removeCookie } from "../src/background/cleaners/cookieCleaner" ; export function quickCookieDomainInfo ( domain , type ) { const className = `cleanup_type_${ type }` ; return { domain , className , i18nBadge : `${ className }_badge` , i18nButton : `${ className }_button` } ; } export function quickSetCookie ( domain , name , value , path , storeId , firstPartyDomain ) { return browser . cookies . set ( { url : "mock" , name , value , domain , path , storeId , firstPartyDomain } ) ; } export function quickRemoveCookie ( domain , name , path , storeId , firstPartyDomain , secure = false ) { return removeCookie ( { name , domain , path , storeId , firstPartyDomain , value : "" , hostOnly : false , secure , httpOnly : false , session : false , sameSite : "no_restriction" } ) ; } export function quickHeadersReceivedDetails ( url , tabId , responseHeaders ? ) { return { url , tabId , responseHeaders , requestId : "mock" , method : "get" , frameId : 0 , parentFrameId : - 1 , type : "main_frame" , thirdParty : false , timeStamp : Date . now ( ) , statusLine : "HTTP/0.9 200 OK" , statusCode : 200 } ; } export function quickBeforeRedirectDetails ( url , redirectUrl , tabId , frameId = 0 ) { return { requestId : "request" , url , method : "get" , frameId , parentFrameId : - 1 , tabId , type : frameId === 0 ? "main_frame" : "sub_frame" , thirdParty : false , timeStamp : - 1 , fromCache : false , statusCode : 200 , redirectUrl , statusLine : "OK" } ; } export function quickHttpHeader ( name , value ? ) { return { name , value } ; }