gcollazo / BrowserRefresh-Sublime

This plugin will switch from ST2 and ST3 to Google Chrome, Google Chrome Canary, Safari, Firefox or Opera and reload the active tab
http://gcollazo.github.com/BrowserRefresh-Sublime
565 stars 62 forks source link

Support for browsers that do not support Apple Script #8

Closed mrfr0g closed 12 years ago

mrfr0g commented 12 years ago

...efresh the page

This update addresses a personal need to refresh browsers that don't yet support the Apple Script dictionary for tabs/windows. The Apple Script utilizes System Events to first activate the specified browser, then sends the key strokes for "command+shift+r" to hard reload the page.

Google Chrome has been kept as the default browser, but users can specify other browsers using the browserName argument from the keyboard shortcut. The default keymap file has been updated to reflect this new option.

gcollazo commented 12 years ago

Looks great, I will give it a try and merge it if everything is ok.

mrfr0g commented 12 years ago

Awesome, one small change might be to allow the user to specify the delay via an argument. I've found that .5 seconds has worked the best for me.

gcollazo commented 12 years ago

Just noticed that this will make it imposible to refresh without activating the browser. Can you confirm?

mrfr0g commented 12 years ago

I haven't experienced that. In my tests Safari/Chrome both refreshed without issue. Firefox had a small issue where the key command, CMD+SHIFT+R would clear the firebug console if firebug had focus.

Can you provide a test case for this behavior?

lucaorio commented 12 years ago

hey! would be great to customize this one to open and refresh safari. i tried to install the @mrfr0g forked one but unfortunately it's not working for me

mrfr0g commented 12 years ago

Can you provide me with your keybindings configuration? It should look something like...

{
    "keys": ["command+shift+r"], "command": "browser_refresh", "args": {
        "activate_browser": true,
        "browserName" : "Safari"
    }
}

The browserName argument needs to match the OSX name, because this uses Applescript to execute the refresh/activate commands.

lucaorio commented 12 years ago

im sorry if im writing here but until your pull request is not accepted i don't wanna open a new issue on this repo.

Default (OSX).sublime-keymap is configured exactly like the one you write me. my ST2 version is Beta, Build 2209, and @gcollazo 's one is working fine with this version.

unfortunately i don't know if there's a way to send you a bug report.

mrfr0g commented 12 years ago

@a2co I tried to send you an email from your about.me site, if you did not receive it please feel free to email me at camden.michael@gmail.com.

lucaorio commented 12 years ago

@mrfr0g just replied you! thanks a lot