Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8729661
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:52:18+00:00 2026-06-13T08:52:18+00:00

I want to delete all cookie on certain domain automatically so I have crafted

  • 0

I want to delete all cookie on certain domain automatically so I have crafted an extension.I am able to view the cookies for the domain but I didn’t find any method to delete them

Here is my code the function eraseCookie is just called one time

Any suggestions ?

function eraseCookie(name) {
    document.cookie = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;';
}

$(document).ready(function() {


var cookies = document.cookie.split(";");
for (var i = 0; i < cookies.length; i++)
{
  window.alert(cookies[i]);
  eraseCookie(cookies[i].split("=")[0]);
}

});

I am also using jquery but I don’t see a problem in that!

    {
        "name": "Gapa",
        "version": "0.1",
        "description": "",
        "browser_action":   {
            "default_icon": "sigla.png",
            "default_title": "",
            "popup": "hello.html"
        },
        "content_scripts": [
        {
          "matches": ["*://*.google.ro/*"],
          "js": ["jquery-1.8.2.min.js","cookie_handler.js"]
        }
      ],
       "icons": {
          "128":"sigla.png" },
       "permissions": [
        "cookies",
        "tabs",
        "*://*.google.ro/*"
      ],
      "manifest_version": 2


    }

LE :
Here is how my script file looks now:

$(document).ready(function() {

var cookies = document.cookie.split(";");
for (var i = 0; i < cookies.length; i++)
{
  chrome.cookies.remove({"url": ".google.ro", "name":cookies[i].split("=")[0]}, function(deleted_cookie) { window.alert('deleted cookie') });
}

});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T08:52:19+00:00Added an answer on June 13, 2026 at 8:52 am

    First of all you must provide cookies permission in your manifest.

    Second of all Chrome provides you with cookies api where remove function is localted:

    chrome.cookies.remove(object details, function callback);
    

    You can use it like that:

    chrome.cookies.remove({"url": "http://domain.com", "name": "cookieName"}, function(deleted_cookie) { console.log(deleted_cookie); });
    

    Try using this to list all cookies for selected domains (inner delete function removes all cookies from this domain):

    chrome.cookies.getAll({domain: "domain.com"}, function(cookies) {
        for(var i=0; i<cookies.length;i++) {
            chrome.cookies.remove({url: "http://domain.com" + cookies[i].path, name: cookies[i].name});
        }
    });
    

    In your manifest.json add:

      "background": {
        "scripts": ["background.js"]
      },
    

    and in background.js you include proposed function.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to delete all subdirectories and files from a directory, but not the
I have a html document and I want to delete all the divs of
I want to delete all the data rows in the table, but without dropping
I have several files with name abc* and i want to delete all those
I want to delete all the cookies if my page is navigating to other
Is there a way to get cookies for specific domain (Facebook) and delete all
I want to delete all but the 4 newest directories in my parent directory.
I want to delete all files with the extension .bak in a directory. How
Hi I have want delete all the entries in my SharedPreferences in android.How can
I want to delete all files in a directory with a given name, except

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.