Skip to content

Instantly share code, notes, and snippets.

@seanvikoren
Last active November 8, 2016 20:09
Show Gist options
  • Save seanvikoren/5443912ff4baf825327166b7e79b818f to your computer and use it in GitHub Desktop.
Save seanvikoren/5443912ff4baf825327166b7e79b818f to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name NewTabMostVisitedRemoval
// @namespace http://tampermonkey.net/
// @version 0.1
// @description remove elements from newtab
// @author Sean Vikoren
// @match https://*/*
// @run-at document-end
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_deleteValue
// ==/UserScript==
/* jshint -W097 */
'use strict';
// Remove Elements
const REGEXP = /^https?:\/\/www.google.[a-z.]+\/\_\/chrome\/newtab.*/;
var isDefaultNewTab = REGEXP.test(top.location.href);
//var isDefaultNewTab = false;
if (isDefaultNewTab) { // If default new tab
var killList = ['most-visited'];
for (var i = 0; i < killList.length; i++) {
var killMe = document.getElementById(killList[i]);
if (killMe) {
killMe.parentNode.removeChild(killMe);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment