如果点击扩展名图标,则删除多个子域Cookie

时间:2019-02-12 17:36:53

标签: google-chrome cookies

如果我点击扩展程序图标以删除这些网站的cookie,如何制作此代码:

removeAllCookies(function () {
    var ca = cookie.split(';');
    for (var i = 0; i < ca.length; i++) {
        try {
            var name = ca[i].split('=')[0].trim();
            var val = ca[i].split('=')[1].trim();;
            chrome.cookies.set({ url: "https://www.facebook.com", name: name, value: val });
            chrome.cookies.set({ url: "https://web.facebook.com", name: name, value: val });
            chrome.cookies.set({ url: "https://m.facebook.com", name: name, value: val });
            chrome.cookies.set({ url: "https://mbasic.facebook.com", name: name, value: val });
            chrome.cookies.set({ url: "https://developers.facebook.com", name: name, value: val });
            chrome.cookies.set({ url: "https://upload.facebook.com", name: name, value: val });
            chrome.cookies.set({ url: "https://mobile.facebook.com", name: name, value: val });
            chrome.cookies.set({ url: "https://business.facebook.com", name: name, value: val });

0 个答案:

没有答案