From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9+) Gecko/20020327 BuildID: 0000000000 I would like to see mozilla accept data as standard input on the unix command line. It would be nice to be able to pipe an html file through a shell script before rendering it in Mozilla. As one person on npm.general suggested, you could run it through ispell, and put <span class="misspelled"></span> tags around every misspelled word, and then style them red to bring out typos. You could do a simple one line sed script to insert a link to a stylesheet in the header of a file to restyle it without changing the file. Several people on the news group suggested work arounds, including using named pipes and the 'data:' url prefix. Both of these are great, but it would be even nicer to see Mozilla play nice the UNIX Way(TM). Reproducible: Always Steps to Reproduce: 1. execute: sed -e s/<head>/<head><link rel=\"stylesheet\" href=\"x.css\" \ type=\"text\/css\">/ file.html|mozilla from any standard unix command line. Actual Results: Mozilla ignores standard input Expected Results: Opened on a page displaying the text of file.html as modified by the sed script.
ok, so what happens if i do: echo "<b>hi" | mozilla -browser -mail fwiw, you can use data:text/html,<youroutputhere> today something like: mozilla `perl -e '$chomp($cwd = `pwd`);s!<head>!<head><base href="file:////$cwd"><link rel="stylesheet" href="x.css" type="text/css">!;s!^!data:text/html,!m;' file.html` [code untested, most shells will not approve...]
Actually, I can't think of a single GUI app that plays nice with the "UNIX Way". By its very nature, a Unix app should not print things to stdout and it should be able to run without needing input from stdin. Every single app that _does_ "play nice" with the "UNIX Way" will block and wait for input on stdin if none is provided -- an unacceptable behavior for a web browser. I can maybe see adding a switch that says "read from stdin, run through the unknown content decoder, and use as the start page". But what if Mozilla is already running? In other words, this needs a much clearer proposal as to what the expected behavior is in various situations.
It wouldn't be unreasonable to do something like mozilla - and have it read from stdin.
Have it read from stdin and do what? Keep reading until when? What happens if I do: echo '<html><body>doc 1</body></html><html><body>doc 2</body></html>' | mozilla - ? Again, this needs to actaully have a decent proposal... at the moment, I fail how this can be useful at all, unless we also have a "quit when done processing stdin" option or something....
Confirming for further triage.