Button that closes page and deletes from history?


(Paul Brown) #1

Hi - I need to have a button on a site I’m creating for a client that hen clicked closed the page and deletes the history.

It’s for people using the site that don’t others to know they’re on or have been on it (abuse concerns etc)

Does anything like that exist or does someone clever know how to make that work?

Cheers!


(Will Woodgate) #2

Hi,

You can’t access or delete a users history. This is private data stored deep within the browser. Only a user themselves can delete their own browser history / cookies etc. from the menu bar or settings / preferences.

Closing the current tab / window is easy to do with a stack like ActionHost. You will want to create a simple link or button in your page like this:

<a href="#">Close Window</a>

In the ActionHost stack, set the Trigger Value to the same label as your link (e.g. Close Window), set Action Type to Execute Custom jQuery. In the jQuery Code box, enter:

window.close();

Now you will have yourself an instant button that should close the current tab or window on any modern browser. A screenshot of the ActionHost settings are shown.

00

Of course, you can do it without ActionHost, using vanilla Javascript or your own jQuery. But the code is complicated if you go the DIY approach. ActionHost makes it way faster and easier. Plus you can use ActionHost for loads of other link manipulation tasks too. So it is one for the toolbox.


(Paul Brown) #3

willwood - many thanks - that looks perfect! Thanks for your quick help on that.

Cheers