Skip to content

Commit

Permalink
Cleanup - fixes for Opera and Chrome
Browse files Browse the repository at this point in the history
  • Loading branch information
jrie committed Aug 19, 2018
1 parent d020202 commit c351fe3
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions cookies.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,6 @@ async function clearCookiesAction (action, data, cookies, domainURL, currentTab,
if (!useChrome) browser.contextualIdentities.get(currentTab.cookieStoreId).then(firefoxOnGetContextSuccess, firefoxOnGetContextError)
else contextName = 'default'

console.log(contextName)

if (cookieData[domainURL] === undefined) cookieData[domainURL] = {}
if (cookieData[domainURL][contextName] === undefined) cookieData[domainURL][contextName] = []

Expand Down Expand Up @@ -1100,16 +1098,23 @@ function clearCookiesOnRequestChrome (details) {
if (currentTab.url !== details.url) currentTab.url = details.url

clearDomainLog(null, currentTab)
let domainURL
let urlMatch = details.url.replace(/\/www\./, '/').match(/(http|https):\/\/[a-zA-Z0-9öäüÖÄÜ.\-][^\/]*/)
if (urlMatch !== null) domainURL = urlMatch[0]
else domainURL = details.url.replace(/\/www\./, '/')

if (cookieData[domainURL] !== undefined && cookieData[domainURL][contextName] !== undefined) cookieData[domainURL][contextName] = []
}

cookieData = {}
if (openTabData[currentTab.windowId] !== undefined && openTabData[currentTab.windowId][currentTab.id] !== undefined) {
openTabData[currentTab.windowId][currentTab.id] = {}
}
}

currentTab.url = details.url



addTabURLtoDataList(currentTab, details)
let domainURL
let urlMatch = details.url.replace(/\/www\./, '/').match(/(http|https):\/\/[a-zA-Z0-9öäüÖÄÜ.\-][^\/]*/)
Expand Down

0 comments on commit c351fe3

Please sign in to comment.