Search code examples
webkittextmatepreviewchromium

Change TextMate live webpreview to use Chrome's Webkit


Currently Textmate uses Safari's Webkit to render the hmlt outputs for both commands and the live webpreview window.

Unfortunately for one specific project I am working with specific javascript API supported only be Firefox's gecko or Chrome's Webkit, it seems Safari still not supporting it.

Perhaps there's a way to globally change Safari for Chromium or Webkit Nightly?


Solution

  • A support member of TextMate kindly answered my email asking for it by mentioning this url which definitely points to the right solution. I really didn't think it could be done so seamlessly and now I am very happy that it is possible.

    Basically there are few steps to follow:

    $ cd /Applications/TextMate.app/Contents/MacOS/
    $ mv TextMate _TextMate
    $ vim TextMate
    

    new TextMate file contains (note that you might want to change the path for the new webkit framework to fit the one you like)

    #!/bin/bash
    env DYLD_FRAMEWORK_PATH=/Applications/WebKit.app/Contents/Frameworks/10.6/WEBKIT_UNSET_DYLD_FRAMEWORK_PATH=YES /Applications/TextMate.app/Contents/MacOS/_TextMate
    

    after saving the newly created file:

    $ chmod a+x TextMate
    

    Close/Run TextMate :)

    Or obvious if you just want to do this for each session you can simply use the bash command right away from terminal like this:

    $ env DYLD_FRAMEWORK_PATH=/Applications/WebKit.app/Contents/Frameworks/10.6/ WEBKIT_UNSET_DYLD_FRAMEWORK_PATH=YES /Applications/TextMate.app/Contents/MacOS/TextMate
    

    This is really cool...one thing I've noticed after that is that my themes are no longer being displayed, have no clue about it but I will try to check the cause.