I find myself in need of a script to (1) open a link in a new tab and (2) close the current tab so the back button cannot be used to see the website that was previously being viewed. This is a security feature for a site, and unfortunately I'm at a complete loss. Nothing I've tried works and I don't know where to begin. This is likely very simple and is staring me in the face, but I don't normally find myself needing to use java for anything. Any ideas?
Asked
Active
Viewed 198 times
0
-
generally, javascript can only close a window/tab that was opened by javascript in the first place - so, (if I'm right) you wont be able to do what you want – Jaromanda X Dec 04 '17 at 00:19
-
`but I don't normally find myself needing to use java for anything` - you mean javascript, because java is nothing to do with it – Jaromanda X Dec 04 '17 at 00:20
1 Answers
0
Its impossible, but as found in this thread how to stop browser back button using javascript you can prevent users from going back.
Theres a JS bin with an example
Edit - Please bear in mind the warning 'It is generally a bad idea overriding the default behavior of web browser.'

LoveHateDevelopment
- 224
- 2
- 9