mirror of
https://github.com/alyssaxuu/omni.git
synced 2026-03-11 08:54:35 +00:00
Add Action to clear cookies of the current tab. (issue 81)
This commit is contained in:
parent
09b7244f89
commit
8ddfa54381
2 changed files with 14 additions and 0 deletions
|
|
@ -70,6 +70,7 @@ const clearActions = () => {
|
|||
{title:"Clear all browsing data", desc:"Clear all of your browsing data", type:"action", action:"remove-all", emoji:true, emojiChar:"🧹", keycheck:false, keys:['⌘','D']},
|
||||
{title:"Clear browsing history", desc:"Clear all of your browsing history", type:"action", action:"remove-history", emoji:true, emojiChar:"🗂", keycheck:false, keys:['⌘','D']},
|
||||
{title:"Clear cookies", desc:"Clear all cookies", type:"action", action:"remove-cookies", emoji:true, emojiChar:"🍪", keycheck:false, keys:['⌘','D']},
|
||||
{title:"Clear current site cookies", desc:"Clear cookies for the current tab", type:"action", action:"remove-current-cookies", emoji:true, emojiChar:"🍪", keycheck:false, keys:['⌘','D']},
|
||||
{title:"Clear cache", desc:"Clear the cache", type:"action", action:"remove-cache", emoji:true, emojiChar:"🗄", keycheck:false, keys:['⌘','D']},
|
||||
{title:"Clear local storage", desc:"Clear the local storage", type:"action", action:"remove-local-storage", emoji:true, emojiChar:"📦", keycheck:false, keys:['⌘','D']},
|
||||
{title:"Clear passwords", desc:"Clear all saved passwords", type:"action", action:"remove-passwords", emoji:true, emojiChar:"🔑", keycheck:false, keys:['⌘','D']},
|
||||
|
|
@ -328,6 +329,15 @@ const clearBrowsingData = () => {
|
|||
const clearCookies = () =>{
|
||||
chrome.browsingData.removeCookies({"since": 0});
|
||||
}
|
||||
const clearCurrentCookie = () => {
|
||||
getCurrentTab().then((response) => {
|
||||
chrome.browsingData.remove({
|
||||
"origins": [response.url]
|
||||
}, {
|
||||
"cookies": true
|
||||
});
|
||||
});
|
||||
}
|
||||
const clearCache = () => {
|
||||
chrome.browsingData.removeCache({"since": 0});
|
||||
}
|
||||
|
|
@ -402,6 +412,9 @@ chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
|
|||
case "remove-cookies":
|
||||
clearCookies();
|
||||
break;
|
||||
case "remove-current-cookies":
|
||||
clearCurrentCookie();
|
||||
break;
|
||||
case "remove-cache":
|
||||
clearCache();
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -357,6 +357,7 @@ $(document).ready(() => {
|
|||
case "remove-all":
|
||||
case "remove-history":
|
||||
case "remove-cookies":
|
||||
case "remove-current-cookies":
|
||||
case "remove-cache":
|
||||
case "remove-local-storage":
|
||||
case "remove-passwords":
|
||||
|
|
|
|||
Loading…
Reference in a new issue