Search code examples
javascriptgoogle-chromegoogle-chrome-extensionbrowser-history

Delete website from Most Visited section in New Tab


I'm creating an extension which deletes history. I managed to delete history using this function provided from Chrome:

var millisecondsPerWeek = 1000 * 60 * 60 * 24 * 7;
var oneWeekAgo = (new Date()).getTime() - millisecondsPerWeek;
chrome.browsingData.remove({
  "since": oneWeekAgo
}, {
  "appcache": true,
  "cache": true,
  "cookies": true,
  "downloads": true,
  "fileSystems": true,
  "formData": true,
  "history": true,
  "indexedDB": true,
  "localStorage": true,
  "pluginData": true,
  "passwords": true,
  "webSQL": true
}, callback);

But sites visited during this period appear in that Most Visited section of New Tab in Chrome.


Solution

  • Unfortunately, it doesn't seem to be possible.

    It's not an option you can specify for browsingData, and corresponding API, chrome.topSites, is read-only.