Giter Site home page Giter Site logo

gcollazo / browserrefresh-sublime Goto Github PK

View Code? Open in Web Editor NEW
565.0 565.0 61.0 1.12 MB

This plugin will switch from ST2 and ST3 to Google Chrome, Google Chrome Canary, Safari, Firefox or Opera and reload the active tab

Home Page: http://gcollazo.github.com/BrowserRefresh-Sublime

Python 99.69% JavaScript 0.31%

browserrefresh-sublime's People

Contributors

bradleyboy avatar cnlevy avatar compmike avatar enriquein avatar focusaurus avatar gcollazo avatar generalov avatar gfreezy avatar leafbird avatar mrfr0g avatar ohgyun avatar strangeblackhole avatar vojtajina avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

browserrefresh-sublime's Issues

Command refreshes active tab on every open browser window

Very glad you made this plugin, thanks, but...

Steps

Hit ctrl+shift+r.

Expected

Active tab of most recent browser window refreshes.
Focus stays on sublime or switches to most recent browser window.

Outcome

Active tab of ALL non-minimized (not sure about minimized) browser windows refreshes.
Each non-minized browser window is made active in turn as the refresh initiates.

Attempted

Googling ;)
Setting the activate_browser to false in Default (Windows).sublime-keymap.
Setting browser_name to "Google Chrome" in Default (Windows).sublime-keymap.

Workaround

Minimizing all windows except the one I want to reload. Not so convenient since I have the local template I'm converting in another window.

Additional

ST2 64 bit Build 2217 on Windows 7 Ultimate 64 bit.
Default (Windows).sublime-keymap contents:

[
    {
        "keys": ["ctrl+shift+r"], "command": "browser_refresh", "args": {
            "auto_save": true,
            "delay": 0.5,
            "activate_browser": false,
            "browser_name" : "Google Chrome"
        }
    }
]

Thanks!

Not working, got a traceback about ctypes

This doesn't seem to work for me. I get this stacktrace on the console:

Traceback (most recent call last):
  File "C:\Program Files\Sublime Text 3\sublime_plugin.py", line 543, in run_
    return self.run(edit, **args)
  File "BrowserRefresh in C:\Users\andy\AppData\Roaming\Sublime Text 3\Installed Packages\Browser Refresh.sublime-package", line 88, in run
  File "C:\Users\andy\AppData\Roaming\Sublime Text 3\Installed Packages\Browser Refresh.sublime-package\win\__init__.py", line 29, in safari
  File "C:\Users\andy\AppData\Roaming\Sublime Text 3\Installed Packages\Browser Refresh.sublime-package\win\pywinauto\application.py", line 927, in connect_
  File "C:\Users\andy\AppData\Roaming\Sublime Text 3\Installed Packages\Browser Refresh.sublime-package\win\pywinauto\application.py", line 1188, in process_from_module
ctypes.ArgumentError: argument 1: <class 'TypeError'>: expected LP_c_ulong instance instead of pointer to c_long_Array_2000

I was using BrowserRefresh v1.4.0

I'm in Windows 7, attempting with Firefox 35.0.1 (although it doesn't look like it got to the browser). Using SublimeText 3 build 3065.

Detect when the developer console is open (Chrome)

When coding, I always open the console in a new window, meaning that I have two Chrome windows. Sometime I have to use the Inspect Element function while developing , then switch to ST2, make a change and hit cmd+shift+r , but since the last thing that I did was using the console, it refresh the console, and not the active tab in the other chrome window (the one that has pages).

I understand why this happens, but maybe there's a way to bypass this and use the other window. I'm open to discuss about some solutions if you want. Or maybe you already know that and already know how you'll fix it? ;)

Thanks for the plugin btw, works great.

Pref menu not available in Win64

This plugin rules! Works like a dream on my Mac at home.

At work, I'm on Win7 64-bit, and after installing/re-installing the plugin, I have no Browser Refresh preference options available for tweaking the 'Preferences' menu.

I'm trying to switch the browser to 'Firefox', and activate_browser to false.

When I go to Preferences > Package Settings > Browser Refresh, my only options are:

  • Key Bindings - Default
  • Key Bindings - User

I have no 'Settings' options for adding my desired prefs - putting them within the key binding in either of these places has no effect.

Doesn't Reload Chrome

Just installed the plug-in via package control. After hitting command + shift = r nothing happens, the page (tab) doesn't reload. Didn't get any errors during installation.

Nothing happens

I can't get this plugin to work on OSX 10.8 DP2.
Cmd+Shift+R, and nothing happens.

I tried installing the package both via Package Control and by cloning the repo—same result.
I get no errors in OSX Console, and restarting ST2 or Chrome doesn't help.

Opening extra safari on Mac OS X 10.9.1

After hiting cmd+shift+r, not only refreshes opened browsers, but opens closed safari as well even if it is closed with cmd+q
Config:

"keys": ["command+shift+r"], "command": "browser_refresh", "args": {
            "auto_save": true,
            "delay": 0.0,
            "activate_browser": false,
            "browser_name" : "all"
        }

Sublime Text 2

Browser refresh not working: "Cannot open Browser Refresh.sublime-package"

I'm running Sublime Text 3 build 3059 on OS X 10.9.1, and installed Browser Refresh 0.3.0 via Package Control. At some point within the last week, my trusty Browser Refresh keyboard shortcut stopped refreshing my browser. If I have auto_save enabled, the current file will save, but the actual part where the browser refreshes does not occur, regardless of browser_name. Also, I get this error in the ST console:

Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 543, in run_
    return self.run(edit, **args)
  File "BrowserRefresh in /Users/trevor/Library/Application Support/Sublime Text 3/Installed Packages/Browser Refresh.sublime-package", line 34, in run
zipimport.ZipImportError: bad local file header in /Users/trevor/Library/Application Support/Sublime Text 3/Installed Packages/Browser Refresh.sublime-package

I've tries reinstalling the package with Package Control. I've also tried manually installing it by cloning the repo, in which case the traceback changes slightly:

Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 543, in run_
    return self.run(edit, **args)
  File "/Users/trevor/Library/Application Support/Sublime Text 3/Packages/Browser Refresh/BrowserRefresh.py", line 34, in run
    from mac import MacBrowserRefresh
  File "<frozen importlib._bootstrap>", line 1558, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1525, in _find_and_load_unlocked
OSError: zipimport: can not open file /Users/trevor/Library/Application Support/Sublime Text 3/Installed Packages/Browser Refresh.sublime-package

Checking out an older Browser Refresh commit does not help. Something else must have changed, but I can't think of anything in my setup that could have affected it. Any ideas?

Safari starting up on refresh

There seems to be a bug where Safari (on a Mac) starts up when it's not running on refresh. The currently running browser (in my case Firefox Developer Edition) is refreshing after launching Safari.
For now, as a temporary workaround, I commented out Safari, since I don't use that for testing.

In BrowserRefresh.py I commented out:

        elif browser_name == 'all':
            refresher.chrome()
           # refresher.safari()
            refresher.firefox()
            refresher.opera()

Don`t refresh in Windows 8.1 with Chrome 40.0.2214.94 m

There is no refresh in Windows 8.1 with Chrome 40.0.2214.94 m. File have been saved and opened successfully with "Open in browser". Cmd-Shift-r saved current file, but there is no refresh in browser.
Restarted Sublime Text 2.0.2 build 2221 as well as Chrome. Didn't help.

Browser Refresh not working on Chrome (Mac)

Hi,

I just downloaded Browser Refresh on Sublime Text 2 and it's not working when I have a doc open in Chrome. When I press command+shift+r it saves the file but does not switch to Chrome and refresh. Am using Chrome version 38.

I tried on Safari, however, and it worked fine. Any suggestions?

Not working for me

Installed the plugin, do the hot key, nothing happens.

Mac console logs show the following errors when I try:

com.sublimetext.2[37801]     57:60:
com.sublimetext.2[37801]     syntax error: Expected end of line but found property. (-2741)

I installed by cloning repo into my Packages dir. Any ideas?

Nothing in Chrome 29 on OS X 10.6.8

There is no refresh in OS X 10.6.8 with the current Chrome 29. File have been saved and opened successfully with "Open in browser". Cmd-Shift-r does absolutely nothing.
Restarted Sublime Text 2.0.2 build 2221 as well as Chrome. Didn't help.

Different delays by file-type possible?

Is saw that a delay parameter was added for compiled scripts. So that you can say... delay 2 seconds before browser-refresh.

Is there a way to let this plugin identify the file-type you refresh/saving, so that you can have different delays for special file-types?

I thought of something like:

.* = 0.5sec <- global
.js = 1sec
.sass, .scss, .less = 2sec

OSX: utf-8 encoded, unable to load plugin

When I start Sublime Text 3 3059 on OSX 10.9.1 I get the following message in the console:

win/pywinauto/unittests/test_SendKeys.py in /Users/jasper/Library/Application Support/Sublime Text 3/Installed Packages/Browser Refresh.sublime-package is not utf-8 encoded, unable to load plugin

Looks like it's including a Windows related thing.

The plugin works fine though, it just shows that message.

Save File Pre-Delay

I'm using the browser-refresh plugin in concert with the Sublime SFTP plugin.

Ideally anytime I use the browser refresh key binding my file would save, which triggers SFTP to upload it, then the delay I have set in my preferences would be carried out, to give the upload time to finish, then the browser refreshes.

Presently the save appears to take place after the delay and my browser often beats the upload so I have to either re-reload or save, then refresh.

Obviously saving manually before refreshing isn't a huge deal, and I love the plugin. Thanks for any consideration!

Trailing whitespace trim occurs after save

In ST2, if you run the browser_refresh command with "auto_save": true, and you have "trim_trailing_white_space_on_save": true in your preferences, then the following occurs in this order:

  1. The document saves
  2. The browser refreshes
  3. Trailing whitespace is trimmed

Because the trimming occurs after the save, the document is now in an unsaved state. It's a nitpick, but is it possible to modify the plugin so that whitespace trimming occurs before the save, as it does when I hit "Save"?

Setting `activate_browser` to false doesn't work

Hello, first of all, thanks for this plugin.

Steps

Create user settings with:

[
    {
        "keys": ["command+shift+r"], "command": "browser_refresh", "args": {
            "auto_save": true,
            "delay": 0.0,
            "activate_browser": false,
            "browser_name" : "Google Chrome"
        }
    }
]

Expected result

Google chrome refreshes, Sublime Text stays active.

Real result

Nothing happens (visible), but the refresh fails. Output from console:

Traceback (most recent call last):
  File "./sublime_plugin.py", line 356, in run_
  File "./BrowserRefresh.py", line 67, in run
    refresher.chrome()
  File "--snip--/mac/__init__.py", line 18, in chrome
    """.format(activate=self.activate)
AttributeError: MacBrowserRefresh instance has no attribute 'activate'

Thank you

Extending for a new option?

Hi
Thanks for the plugin. It works very well.
I just want to know if there is a way to stay in sublime window after refreshing the browser. Or maybe switching to sublime window again after the browser is refreshed.

Thanks

user config not overriding default

in st3

The hotkeys defined in default config still work when there is a user config with different hotkeys defined.

can't override ctrl+shift+r ( which breaks find symbol in project hotkey )

Can't change keybinding

I'm using emmet and it has a keybinding conflict with BrowserRefresh in Preferences > Key Bindings - User. I already tried changing the keybinding into "command+shift+x" but FindKeyConflict still show me "command+shift+r".

Not - working - not saving local file.

OS X 10.8.5, ST2
I hit ⌘+Shift+R and nothing happens in the browser (Chrome/FF/Safari) - but first of all the file in ST is not saved (I have the disc instead of the [x] sign in the file tab).

What can I do to investigate further?

Broken with ST3 (latest) & Win7 : No module named 'findwindows'

This is what I get in the console :

Traceback (most recent call last):
  File "E:\Programs\Sublime Text 3\sublime_plugin.py", line 543, in run_
    return self.run(edit, **args)
  File "E:\Programs\Sublime Text 3\Data\Packages\BrowserRefresh-Sublime-master\BrowserRefresh.py", line 38, in run
    from win import WinBrowserRefresh
  File "E:\Programs\Sublime Text 3\Data\Packages\BrowserRefresh-Sublime-master\win\__init__.py", line 1, in <module>
    from pywinauto.application import Application, ProcessNotFoundError
  File "E:\Programs\Sublime Text 3\Data\Packages\BrowserRefresh-Sublime-master\win\pywinauto\__init__.py", line 28, in <module>
    import findwindows
ImportError: No module named 'findwindows'

Not working with Sublime 3

No response after pressing Ctrl+Shift+r, do I need to do something more?

My Configuration Here,

[
{
"keys": ["command+shift+r"], "command": "browser_refresh", "args": {
"auto_save": true,
"delay": 0.0,
"activate_browser": true,
"browser_name" : "Google Chrome"
}
}
]

Thank you

OSX keymap

Hi,

When I go to key bindings (default) , "keys" is ["command+shift+r"].
By any chance, "keys" is ["super+shift+r"], isn't it?

OSX:10.8.5
ST:2.0.1

Error thrown when executed

I get this error when I execute the binding:

Traceback (most recent call last):
  File "C:\User\U468563\Programs\SublimeText\sublime_plugin.py", line 550, in run_
    return self.run(edit, **args)
  File "BrowserRefresh in C:\User\U468563\Programs\SublimeText\Data\Installed Packages\Browser Refresh.sublime-package", line 88, in run
  File "C:\User\U468563\Programs\SublimeText\Data\Installed Packages\Browser Refresh.sublime-package\win\__init__.py", line 29, in safari
  File "C:\User\U468563\Programs\SublimeText\Data\Installed Packages\Browser Refresh.sublime-package\win\pywinauto\application.py", line 927, in connect_
  File "C:\User\U468563\Programs\SublimeText\Data\Installed Packages\Browser Refresh.sublime-package\win\pywinauto\application.py", line 1188, in process_from_module
ctypes.ArgumentError: argument 1: <class 'TypeError'>: expected LP_c_ulong instance instead of pointer to c_long_Array_2000

Using Sublime Text 3 build 3083 on Win 64 bits.

The error is thrown when trying to refresh Mozilla Firefox

TypeError: 'float' object cannot be interpreted as an integer

OS: Windows 8
ST Version: 3059

Behaviour: On pressing ctrl+shift+r, current file is saved, but browser does not refresh. Observe the following error in console.

TypeError: 'float' object cannot be interpreted as an integer
Writing file /C/Users/Kimberley/Dropbox/soclogwip/TheFour/Assets/email/email.html with encoding UTF-8 with BOM (atomic)
Traceback (most recent call last):
File "C:\Program Files\Sublime Text 3\sublime_plugin.py", line 543, in run_
return self.run(edit, **args)
File "BrowserRefresh in C:\Users\Kimberley\AppData\Roaming\Sublime Text 3\Installed Packages\Browser Refresh.sublime-package", line 84, in run
File "C:\Users\Kimberley\AppData\Roaming\Sublime Text 3\Installed Packages\Browser Refresh.sublime-package\win__init__.py", line 29, in safari
File "C:\Users\Kimberley\AppData\Roaming\Sublime Text 3\Installed Packages\Browser Refresh.sublime-package\win\pywinauto\application.py", line 927, in connect_
File "C:\Users\Kimberley\AppData\Roaming\Sublime Text 3\Installed Packages\Browser Refresh.sublime-package\win\pywinauto\application.py", line 1192, in process_from_module

Support for Maxthon

First, thanks for this great plugin!

Is it possible to add support for Maxthon Cloud Browser? Maxthon used to be really bad when it was very similar to IE, but it has been under heavy developpement and now features many useful things, a better engine, while being fast, reliable and multi-platform. It's my main browser and I'd like to use it with BrowserRefresh-Sublime.

A workaround would be to allow users to set the path of the browser application they want to refresh, instead of the name of the browser, right?

Help: Remove Linux and Windows support

In order to keep Win/Linux support I need to find maintainers that are willing to test and fix bugs on those platforms. Currently I'm only using this package on Mac and don't have the time to support other platforms. Please leave a comment if you are interested.

key bindings conflict with rubytest plugin

Hi,
I was not sure where to share this, but not really an issue unless you have both plugin. I guess you can always just change one of the key bindings, but thought I'd let you know.

Maybe command+shift+c ?

Thanks,
-Mez

FIle is auto saved but browser not refreshing.

I press ctrl+shift+r the file get saved but browser doesn't refresh.

{
"keys": ["ctrl+shift+r"], "command": "browser_refresh", "args": {
"auto_save": true,
"delay": 0.5,
"activate_browser": false,
"browser_name" : "all"
}
}

Windows 7 64-bit / 2 Monitors / Sublime 2 / Chrome Browser

nothing happens

hi!!
i'm trying to make your package work, windows7, sulbime text 2 portable version, but when i do my ctrl+shift+r, nothing happens

have i got to have only one tab on my browser?
how can i make open a new window, or directly open the browser?
thx for answers and sorry for noob questions...

Unable to save or open default keymap

Hi there,

When I go to preferences > package settings > browser refresh > key bindings (default), I get an empty file (but it's not as notepad ++ indicates).

Same when I open from appdata folder directly.

So basically, the plugin does nothing at all :)

Seems to be the only plugin with that problem, any ideas ?

Thanks !

unexpected keyword argument 'activate_browser'

After installing this package into Sublime 2.0.2 (build 2221 Mac OS 10.7.5) via PackageControl, everytime I use the keystroke CMD-Shift-R nothing happens. Neither the file is saved nor the browser is refreshed. The console shows the following error:

Traceback (most recent call last):
File "./sublime_plugin.py", line 356, in run_
TypeError: run() got an unexpected keyword argument 'activate_browser'

This error don't occur under Sublime 3 installed the BrowserRefresh plugin the same way via PackageControl.

But as I remember me correctly, this plugin worked well with Sublime 2 several months ago...

Kind regards
Dominik

Not working (Mac OS X 10.8.5)

Not working. I use Mac OS Lion, Sublime 2, and I've tested several times with Chrome, Canary and Safari without success.

Not working in ST3 under OS X 10.10.1

I'm running Sublime Text stable build 3065 on a Mac with the latest stable OS. My trusty Browser Refresh keyboard shortcut stopped working recently, instead generating this error in the console:

Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 543, in run_
    return self.run(edit, **args)
  File "BrowserRefresh in /Users/trevor/Library/Application Support/Sublime Text 3/Installed Packages/Browser Refresh.sublime-package", line 34, in run
zipimport.ZipImportError: bad local file header in /Users/trevor/Library/Application Support/Sublime Text 3/Installed Packages/Browser Refresh.sublime-package

I tried removing the Package Control-installed package and installing the latest master instead. That yielded a more specific error message:

Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 543, in run_
    return self.run(edit, **args)
  File "/Users/trevor/Library/Application Support/Sublime Text 3/Packages/Browser Refresh/BrowserRefresh.py", line 34, in run
    from mac import MacBrowserRefresh
  File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
OSError: zipimport: can not open file /Users/trevor/Library/Application Support/Sublime Text 3/Installed Packages/Browser Refresh.sublime-package

Any idea why this error is occurring?

Reload tab that meets criteria

I really only want this to reload the active tab if it meets certain criteria. Basically I would like to have a list of urls that it should reload.

I was able to implement this by changing the mac chrome applescript command to:

reload (every tab of winref whose URL contains (contents of "google.com"))

Goto Symbol bug

In Sublime Text 3 (3066), every time I initiate key command ["super+shift+r"], the Goto Symbol search box appears. I have tried different key combinations, but it always appears. Key command for Goto Symbol is set to default.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.