Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to use Javascript to close Android Browser?

I want to put a "close" button in a web page (our client wants to do that)
and when I click this button, I want to close Browser (not the current tab but "browser" in Android Browser, IE, Firefox, Chrome etc.).

I've searched around and found a method: window.close() but seems to only work on IE.
My question is:

Is there any way to close Android Browser using Javascript?

like image 880
sees Avatar asked May 30 '26 22:05

sees


2 Answers

Nope - and that's a Good Thing: the webpage has no business messing with the browser itself ("wait, where did my window go? I had like 30 tabs in there - poof, gone!"), not to mention a glaring vulnerability:

  1. insert an XSS into legitpage.example.com
  2. when it gets activated, open a pop-under window of evilpage.example.net, which looks just like legitpage.example.com
  3. close legitpage.example.com (if 2&3 are fast enough, the user may be fooled that xe's still on legitpage.example.com)
  4. ???
  5. Profit!
like image 111
Piskvor left the building Avatar answered Jun 02 '26 11:06

Piskvor left the building


This is not possible, and never will be.

like image 39
SLaks Avatar answered Jun 02 '26 12:06

SLaks