Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Firefox Developer Edition #66

Closed
AlexKvazos opened this issue Nov 13, 2014 · 17 comments
Closed

Support for Firefox Developer Edition #66

AlexKvazos opened this issue Nov 13, 2014 · 17 comments

Comments

@AlexKvazos
Copy link

Are there any plans to add support for Firefox Developer Edition?

Thanks,
Alex

@gcollazo
Copy link
Owner

@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 😄

@AlexKvazos
Copy link
Author

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?

@waldbach
Copy link

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

@gcollazo
Copy link
Owner

@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

@waldbach
Copy link

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!

@gcollazo
Copy link
Owner

That should be the regex for the search.

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

@waldbach
Copy link

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

@gcollazo
Copy link
Owner

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

@waldbach
Copy link

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)

@waldbach
Copy link

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()

@waldbach
Copy link

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.

@waldbach
Copy link

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)

@waldbach
Copy link

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

@gcollazo
Copy link
Owner

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

@gcollazo
Copy link
Owner

Ok, the new version is up

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

@waldbach
Copy link

Fantastic. Thanks a lot, Giovanni!

@waldbach
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants