Giter VIP home page Giter VIP logo

Comments (17)

gcollazo avatar gcollazo commented on August 12, 2024

@AlexKvazos Pull requests are welcomed. Currently I'm not using FF DevEd so I don't really have a need for it.

If you are interested I can point you in the right direction on how to implement this feature 😄

from browserrefresh-sublime.

AlexKvazos avatar AlexKvazos commented on August 12, 2024

Sure! I'd be glad to help integrate this. What should I have a look at to get an idea of what I have to add?

from browserrefresh-sublime.

waldbach avatar waldbach commented on August 12, 2024

I just stumbled on this issue as well, glad to help as long as I know what to do.

from browserrefresh-sublime.

gcollazo avatar gcollazo commented on August 12, 2024

@waldbach This are the basic things that need to be donde to support a new browser. I'm assuming you are on a Mac.

First you have to create a regex to detect if the browser is running https://github.com/gcollazo/BrowserRefresh-Sublime/blob/master/mac/utils.py

Then make an AppleScript that will actually refresh the browser
https://github.com/gcollazo/BrowserRefresh-Sublime/blob/master/mac/__init__.py

Finally hook everything up in the main plugin file and make sure you test different settings
https://github.com/gcollazo/BrowserRefresh-Sublime/blob/master/BrowserRefresh.py

from browserrefresh-sublime.

waldbach avatar waldbach commented on August 12, 2024

Thanks, I fiddled with those locally, yesterday. But I guess I could not get the naming right for the Developer Edition. I will try again, cheers!

from browserrefresh-sublime.

gcollazo avatar gcollazo commented on August 12, 2024

That should be the regex for the search.

if re.search('FirefoxDeveloperEdition\.app', ps) is not None:
    running_browsers.append('firefoxdeved')

from browserrefresh-sublime.

waldbach avatar waldbach commented on August 12, 2024

Ah, that's very close to what I had yesterday. Will try this, thanks!

from browserrefresh-sublime.

gcollazo avatar gcollazo commented on August 12, 2024

This should be the AppleScript. If it doesn't work you should try adding a delay 0.1 after the activate instruction.

tell application "FirefoxDeveloperEdition"
    activate
    tell application "System Events" to keystroke "r" using command down
end tell

from browserrefresh-sublime.

waldbach avatar waldbach commented on August 12, 2024

For the Applescript I had this:

   def firefoxdeved(self):
        command = """
            tell application "FirefoxDeveloperEdition"
                activate
                tell application "System Events" to keystroke "r" using command down
            end tell
            """

        if 'firefoxdeved' in self.browsers:
            self._call_applescript(command)

from browserrefresh-sublime.

waldbach avatar waldbach commented on August 12, 2024

Not working, yet...

In BrowserRefresh.py I have the following:

        elif browser_name == 'FirefoxDeveloperEdition':
            refresher.firefoxdeved()

and

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

from browserrefresh-sublime.

waldbach avatar waldbach commented on August 12, 2024

Also in utils.py I have

    if re.search(b'FirefoxDeveloperEdition\.app', ps) is not None:
        running_browsers.append('firefoxdeved')

not the b before 'FirefoxDevel...
I tried with and without. Close, but no cigar, yet.

from browserrefresh-sublime.

waldbach avatar waldbach commented on August 12, 2024

In __init__.py I have the following now:

    def firefoxdeved(self):
        command = """
            tell application "FirefoxDeveloperEdition"
                activate
                delay 0.1
                tell application "System Events" to keystroke "r" using command down
            end tell
            """

        if 'firefoxdeved' in self.browsers:
            self._call_applescript(command)

from browserrefresh-sublime.

waldbach avatar waldbach commented on August 12, 2024

My apologies for the struggle here, I know little to none about Python.

from browserrefresh-sublime.

gcollazo avatar gcollazo commented on August 12, 2024

That commit adds the feature. I'll try to release a new version as soon as possible.

from browserrefresh-sublime.

gcollazo avatar gcollazo commented on August 12, 2024

Ok, the new version is up

https://packagecontrol.io/packages/Browser%20Refresh

from browserrefresh-sublime.

waldbach avatar waldbach commented on August 12, 2024

Fantastic. Thanks a lot, Giovanni!

from browserrefresh-sublime.

waldbach avatar waldbach commented on August 12, 2024

There seems to be a bug where Safari starts up when it's not running on refresh. Firefox Dev Ed is refreshing after that.
For now 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()

Now it all works fine! :)

Edit: I just realized this is better posted as a new issue, will do that now.

from browserrefresh-sublime.

Related Issues (20)

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.