[gull] Truc et astuces: Lancer du javascript en ligne de commande

Félix Hauri felix at f-hauri.ch
Tue Oct 23 11:28:25 CEST 2012


Si vous connaisser les URL de type inline-data:

data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOBAMAAADtZjDiAAAAGFBMVEX6+vqAgID///9GRkbj4+MqKiq7u7sICAgzxHUMAAAAa0lEQVQImQ2MMQqEMBREZ+MJLLK2Yczaqwv2IWibHGE/GGsRkuvvr4b34A1IFw0J+q09QffKxd7E9KgdBJ+l5++VcEnjFisGFu6cYSn0ZlX+sjMZh5zv2VeMaVplTPDaO+153sVW/XW25cA/j/cVTgRbOxAAAAAASUVORK5CYII=

Vous pouvez lancer votre navigateur favori avec la syntaxe suivante:
C'est une seule ligne, suivez les apostrophes!
Vous pouver remplacer ``x-www-browser'' par ``chrome'', ``firefox'',
``gnome-browser'', etc...

$ x-www-browser 'data:text/html;charset=ISO-8859-1,<html>
<head>
 <title>TEST Demo</title>
</head>
<body>
 <h3 id="title">Test demo</h3>
 <script language="javascript">
  window.open("http://perso.f-hauri.ch/~felix/svg/dustin_w_Clock_autonom.svg",
              "clock","toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=1,width=600,height=600,top=100,left=120");
  window.open("http://perso.f-hauri.ch/~felix/svg/fw.svg","netrate",
              "toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=1,width=420,height=372,top=40,left=620");
  var s=10;
  function cntdwn()
  {
    document.getElementById("title").innerHTML="Test demo: "+s;s=s-1;
    if (0 > s) {
     window.location="http://perso.f-hauri.ch/~felix/meteo/picture/meteo.html";
    } else window.setTimeout(cntdwn,1000);
  };
  window.onload=cntdwn;
 </script>
 </body>'

--
 Félix Hauri  -  <felix at f-hauri.ch>  -  http://www.f-hauri.ch


More information about the gull mailing list