0

i open url through php in chrome browser like

exec('chrome.exe --app="www.example.com/inex.php?pid=4356546"');

my index.php have some js code it end of js code to close this opened window i call

window.close();

but it give me alert that localhost says [object Object] and OK button

so i was wondering anyway to close this window without any alert , because i will be lunching these windows on server side on my windows server and i want to close them with js

user889030
  • 4,353
  • 3
  • 48
  • 51
  • please show index.php code from where it is showing alert. how we can know from alert is showing @user889030 – Pritamkumar Sep 07 '17 at 11:23
  • https://developer.mozilla.org/en-US/docs/Web/API/Window/close No you cant do that in modern browsers. What are you actually trying to do?( My guess is something like phantomjs would be a better choice) – Steve Sep 07 '17 at 11:25
  • @Steve am doing some image processing on canvas it high dpi , so we thought to use server side for doing heavy task and then load results it user end , because browsers not release memory fully – user889030 Sep 07 '17 at 11:28
  • 1
    Yeah i guessed it would be something like that - i would certainly recommend looking at phantomjs, its a headless, programmable webkit browser – Steve Sep 07 '17 at 11:29

1 Answers1

1

This will be works in Chrome-26 without the use of a helper page:

<script type="text/javascript">
   window.open('javascript:window.open("", "_self", "");window.close();', '_self');
</script>

may be it'll help for you.

gaurav
  • 657
  • 4
  • 11
  • [link](https://stackoverflow.com/questions/57854/how-can-i-close-a-browser-window-without-receiving-the-do-you-want-to-close-thi) click the link button to check there for more details about your problem – gaurav Sep 07 '17 at 11:44