Skip to content

Policy Config

Jay Lee edited this page Feb 20, 2019 · 2 revisions

File format

Currently the policy has the following options. Note that JSON policy files do not allow comments, remove any # lines in the file before setting the policy. You may also want to use an online JSON format validator like https://jsonlint.com/ to make sure you didn't mess up the syntax.

{
  # should general data be cleared for the user.
  "clear_general_data": {
    "Value": true|false
  },

  # should specified cookies be cleared for the user
  "clear_cookies": {
    "Value": true|false
  },
  
  # should specified history be cleared for the user
  "clear_history": {
    "Value": true|false
  },
  
  # when removing general data, only remove data newer than this date. Dates are specified as milliseconds
  # since the Unix epoch (1970). If you have trouble counting that high, use https://currentmillis.com/
  # to figure out a date. Noe that this setting does not apply when clearing cache. All cache will always
  # be removed. Some samples dates:
  # 1535817600000 - Sept 1, 2018
  # 1145718000000 - Apr 22, 2006
  "general_data_remove_newer_than": {
    "Value": "1537637539446"
  },
  
  # The types of general data to clear. See descriptions at
  # https://developer.chrome.com/extensions/browsingData#type-DataTypeSet
  "general_data_to_clear": {
    "Value": ["appcache", "cache", "cookies", "downloads", "fileSystems", "formData",
    "history", "indexedDB", "localStorage", "serverBoundCertificates", "passwords",
    "pluginData", "serviceWorkers", "webSQL"]
  },
  
  # Cookies that will be removed. The extension will search for cookies that match each pattern and
  # remove them. See pattern details at https://developer.chrome.com/extensions/cookies#method-getAll
  "cookie_patterns_to_clear": {
    "Value":
      [
        # remove all cookies associated to *.google.com domains
        {
          "domain": "google.com"
        },
        # remove all cookies for accounts.google.com with name LSID
        {
          "domain": "accounts.google.com",
          "name": "LSID"
        }
      ]
  },
  
  # Search user browsing history and remove any matching history entries. Note that this is a free form
  # search that searches both the URL and the web page title.
  "history_searches_to_clear": {
    "Value":
      [
        # remove any cnn.com URLs from history
        "cnn.com",
        
        # remove any entries that had "widgets" in the URL or title from history
        "widgets"
      ]
  }
}

Example config files

This example completely clears a users cache. Note that general_data_remove_newer_than does not apply to cache, all cache will be cleared no matter what the general_data_remove_newer_than value is.

{
  "clear_general_data": {
    "Value": true
  },
  "general_data_remove_newer_than": {
    "Value": "0"
  },
  "general_data_to_clear": {
    "Value": ["cache"]
  }
}

This example clears a user's Facebook cookies

{
  "clear_cookies": {
    "Value": true
  },
  "cookie_patterns_to_clear": {
    "Value":
      [
        {
          "domain": "facebook.com"
        }
      ]
  }
}
Clone this wiki locally