Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Selectively remove Chrome browsing history

Is it possible to selectively remove items from Google Chrome browsing history? I have a website from my history that wants to be the default everytime I start a search with a specific letter, but I often reference my history to re-find things.

So I would like to remove all history from, say, www.pythonismyfavoritest.com without removing everything; is that possible?

like image 930
Dylan Hettinger Avatar asked Sep 03 '13 17:09

Dylan Hettinger


People also ask

Can you delete history from a specific website?

If you only have a few sites there, you can just ctrl click (or right click) on the site you want to delete. When you hold down the ctrl key and click on the site, a menu will pop up. Just select "forget about this site" from that menu and Firefox will delete it from your history.

Can you remove one thing from search history?

In the History settings box, open the Web & App Activity section. Next, click Manage all Web & App Activity and you'll see a running log of everything you've done with Google services recently. Next to every block labeled Search, click the X button at the top-right to erase that item.


4 Answers

Try searching www.pythonismyfavoritest.com in the search bar in chrome://history/ and then remove each item by clicking the check box in the left and then hitting the "remove selected items" button.

The chrome history api works with url such chrome://history/#q=hello&p=0

https://dl.dropboxusercontent.com/u/31568408/Capture.PNG

like image 150
Alfonso Santiago Avatar answered Apr 02 '23 04:04

Alfonso Santiago


Here's something I wrote in JavaScript. It works through the Console Debugger. I tried using it in a bookmark but I get no response from the page.

** // UPDATE (07.28.15)
I added a shorter approach provided by @Denis Gorbachev to the checkbox targeting, which helped shorten some of this code. I also added "auto-stop" functionality, meaning the loop will stop once it has finally cleared the list.

** // UPDATE (08.20.14)
I made a few changes to the code, to make it more user friendly. Other users may not be code-savvy, and others may simply prefer convenience. Therefore, I whipped up a couple buttons (start/stop) to control the usage; as well as address some "ASSERTION FAILED" exceptions/errors that were being thrown when attempted to run the script loop.. Enjoy!!

In your address bar, type in the following address to to the meat of the history page.. It's normally loaded in an iframe, with the left-side menu loaded in another frame.. // **

chrome://history-frame/

Next, load your Console Debugger/Viewer by pressing Ctrl+Shift+J
(For Mac users, ++J)

You can also press F12 and select the "Console" tab.

In the Console Debugger/Viewer, copy & paste the following code:

function removeItems() {
removeButton = document.getElementById('remove-selected');
overlayWindow = document.getElementById('overlay');
    //revision (07.28.15): Replaced the For Loop targeting the checkboxes, thanks to Denis Gorbachev via comments (02.19.15)
Array.prototype.forEach.call(document.querySelectorAll("input[type=checkbox]"), function(node) {node.checked = "checked"})
setTimeout(function () {
    if (removeButton.getAttribute("disabled") !== null) {
        removeButton.removeAttribute("disabled")
    }
    /* revision (08.20.14): no longer binding to that condition, button should no longer be disabled, so click! */
    if ((overlayWindow.hasAttribute("hidden")) && (overlayWindow.getAttribute("hidden") !== false)) {
        removeButton.click();
    }
    /* revision (08.20.14): new Interval, to check against the overlay DIV containing the confirmation "Remove" button */
    /* Attempting to click the button while the DIV's "hidden" attribute is in effect will cause FAILED ASSERTION */
    stopButton = setInterval(function () {
        if (overlayWindow.hasAttribute("hidden")) {
            if (overlayWindow.getAttribute("hidden") == "false") {
                hidden = false
            } else {
                hidden = true
            }
        } else {
            hidden = false
        }
        if (!hidden) {
            document.getElementById("alertOverlayOk").click();
            clearInterval(stopButton)
        }
    }, 250)
}, 250)
}
//revision (08.20.14): Lets build our buttons to control this so we no longer need the console
//stop button (08.20.14)
var stopButton = document.createElement('button');
stopButton.setAttribute('id', "stopButton");
stopButton.innerHTML = "Stop";
stopButton.style.background = "#800";
stopButton.style.color = "#fff";
stopButton.style.display = "none";
stopButton.onclick = function () {
    clearInterval(window.clearAllFiltered);
    document.getElementById("stopButton").style.display = "none";
    document.getElementById("startButton").style.display = ""
};
//start button (08.20.14)
var startButton = document.createElement('button');
startButton.setAttribute('id', "startButton");
startButton.innerHTML = "Start";
startButton.style.background = "#090";
startButton.style.color = "#fff";
startButton.onclick = function () {
    window.clearAllFiltered = setInterval(function () {
/* revision (07.28.15): Stop the Loop automatically if there are no more items to remove */
        if(document.getElementById("results-header").innerText=="No search results found."){
            document.getElementById("stopButton").click();
            }
        if (document.getElementById("loading-spinner").getAttribute("hidden") !== null) {
            removeItems()
        }
    }, 250); //adjust Time Here (1500 [millisec] = 1.5sec)
    document.getElementById("stopButton").style.display = "";
    document.getElementById("startButton").style.display = "none"
};
/* revision (08.20.14): Now we add our buttons, and we're ready to go! */
editingControls = document.getElementById('editing-controls');
editingControls.appendChild(stopButton);
editingControls.appendChild(startButton);

This removeItems function will select loop through all form inputs and check all checkboxes, enable the "Remove Selected Items" button and click it. After a half-second, it'll check if the "Are You Sure" prompt is displayed and, if so, click the "Yes/Remove" button automatically for you so that it will load a new list of items to do this process all over again..

The item is looped using the variable "clearAllFiltered", which is a setInterval loop, which is checking for the status of the "Loading" screen..

To start erasing your filtered history items, you can now click the green Start button.

** // UPDATE (07.28.2015) It will now stop on ITS OWN.

To stop the loop manually, you can now click the red Stop button. Simple as that!

like image 43
Jacob Cruz Avatar answered Apr 02 '23 05:04

Jacob Cruz


1) Go to your history settings ( chrome://history/ )

2) In the top right hand corner will be a search bar with a 'Search History" button

3) Type in the sitename you want to remove from history, then click the button

4) Click the box on the first one, then scroll to the bottom of the page

5) Press and hold the Shift key, then click the last box (This will check all on that page)

6) Scroll back up and select the 'Remove Selected Items" Button

7) Repeat steps 4-6 until all your Youtube History is gone.

Hopefully Chrome will update this clear history feature, but for now this seems to be the fastest option

like image 41
Robert Benyi Avatar answered Apr 02 '23 04:04

Robert Benyi


Easy way is Shift+Delete.

For example when you type "you", "youtube.com" will be shown as selected in suggestions. Just click Shift+Delete. Then retype "you" and you will see no "youtube.com" in that list anymore.

like image 45
LacOniC Avatar answered Apr 02 '23 05:04

LacOniC