Q: How do I programmatically set the new tab page in a Chrome Extension? So by default, the new tab page is replaced with my Chrome extension (via the manifest). However, I'd like to give the option to disable it (programmatically).
How can I do this?

A: Google made a Star Wars new tab replacement which allows you to view the default new tab page. The url it uses is chrome-search://local-ntp/local-ntp.html. Example:
options.html:
<input type="checkbox"> Use default new tab page

options.js:
var checkbox = document.querySelector("input[type=checkbox]")
checkbox.addEventListener("click", function() {
 chrome.storage.sync.set({ defaultnewtab: checkbox.checked })
})

newtab.js:
chrome.storage.sync.get("defaultnewtab", function(storage) {
 if(storage.defaultnewtab) {
  chrome.tabs.update({ url: "chrome-search://local-ntp/local-ntp.html" })
} })

