Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Not trivially. The easiest way would be to write the current file to the temp dir, then launch that file.. but, this would break any relative links (images, scripts, CSS files)</p> <p>Add a bundle:</p> <pre><code>Input: Entire Document Output: Discard Scope Selector: source.html </code></pre> <p>And the script:</p> <pre><code>#!/usr/bin/env python2.5 import os import sys import random import tempfile import subprocess fname = os.environ.get("TM_FILEPATH", "Untitled %s.html" % random.randint(100, 1000)) fcontent = sys.stdin.read() fd, name = tempfile.mkstemp() print name open(name, "w+").write(fcontent) print subprocess.Popen(["open", "-a", "Firefox", name]).communicate() </code></pre> <p>As I said, that wont work with relative resource links, which is probably a big problem.. Another option is to modify the following line of code, from the exiting "Refresh Browsers" command:</p> <pre><code>osascript &lt;&lt;'APPLESCRIPT' tell app "Firefox" to Get URL "JavaScript:window.location.reload();" inside window 1 APPLESCRIPT </code></pre> <p>Instead of having the javascript reload the page, it could clear it, and write the current document using a series of <code>document.write()</code> calls. The problem with this is you can't guarantee the current document is the one you want to replace.. Windows 1 could have changed to another site etc, especially with tabbed browsing..</p> <p>Finally, an option that doesn't have a huge drawback: Use version control, particularly one of the "distributed" ones, where you don't have to send your changes to a remote server - git, mercurial, darcs, bazaar etc (all have TextMate integration also)</p> <p>If your code is in version control, it doesn't matter if you save before previewing, you can also always go back to your last-commited version if you break something and lose the undo buffer.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload