Created
November 7, 2013 16:35
-
-
Save SergioGeeK7/7357582 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sublime, sublime_plugin | |
# import webbrowser | |
# import os | |
import subprocess | |
class RunInBrowserCommand(sublime_plugin.TextCommand): | |
def run(self, edit): | |
url = self.view.file_name() | |
print "[i] filename: " + url | |
url = url.replace('\\', '/') | |
# replace path | |
url = url.replace('/opt/lampp/htdocs', 'http://localhost') | |
print "[i] url: " + url | |
# firefox = webbrowser.get('mozilla') | |
# firefox.open_new(url) | |
# webbrowser.open_new(url) | |
# subprocess.call([r"C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe", url]) | |
#os.system("C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe", url) | |
# os.spawnl(os.P_NOWAIT, "C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe", r'FireFox', '-new-tab', url) | |
pid = subprocess.Popen(["/usr/bin/google-chrome","-incognito", url]).pid |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment