View Single Post
qwazix's Avatar
Moderator | Posts: 2,622 | Thanked: 5,447 times | Joined on Jan 2010
#4
My internal network does have a firewall. And sudo has a password. So no, it doesn't.

If you'd like the previous song to stop when you play another one here's a more elaborate script

index.php
Code:
<?php
$u = $_GET['url'];
echo $u;
$u = rawurlencode($u);
if (isset($u)&&trim($u!="")){
   exec('DISPLAY=:0 firefox "http://localhost/openInPopup.php?url='.$u.'"');
} 
?>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<form action=index.php>
   <input name=url autofocus>
   <button>go</button>
</form>
<form action=index.php>
   <input type=hidden name=url value=about:blank>
   <button>stop</stop>
</form>
openInPopup.php
Code:
<input id=url value="<?=rawurldecode($_GET['url'])?>" />
<script>
  window.open(document.getElementById('url').value,"playToPopup",'height=500,width=1000');
</script>
you still get a bunch of new tabs however. If somebody knows how to open a new named window from the command line for firefox, or how to run javascript from the terminal let me know.

the obvious
Code:
firefox javascript:window.open( ... )
doesn't work
__________________
Proud coding competition 2012 winner: ρcam
My other apps: speedcrunch N9 N900 Jolla –– contactlaunch –– timenow

Nemo UX blog: Grog
My website: qwazix.com
My job: oob

Last edited by qwazix; 2013-05-15 at 22:32.