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

Firefox Support #4

Open
peterkos opened this issue Jul 5, 2018 · 2 comments
Open

Firefox Support #4

peterkos opened this issue Jul 5, 2018 · 2 comments
Labels

Comments

@peterkos
Copy link

peterkos commented Jul 5, 2018

The Chrome version is fully functional in Firefox. Would you consider uploading the extension to AMO as well so Firefox users can benefit from this fix?

@gdelmas
Copy link
Owner

gdelmas commented Jul 15, 2018

After Tower's change to subscription, with no perpetual license option, I will not continue support for this plugin. Sorry for that.

@gdelmas gdelmas closed this as completed Jul 23, 2018
@gdelmas gdelmas reopened this Aug 19, 2018
@RobertAudi
Copy link

You can use this as a userscript without any modification:

// ==UserScript==
// @name        Open in Tower
// @homepage    https://github.com/gdelmas/GithubTower
// @author      Gerard Delmàs
// @namespace   Violentmonkey Scripts
// @icon        https://github.githubassets.com/pinned-octocat.svg
// @grant       none
// @run-at      document-end
// @include     https://github.com/*
// ==/UserScript==
(function() {
    var buttonElement = document.querySelector("a.get-repo-btn");

    if ( buttonElement === null ) {
        return;
    }

    buttonElement.removeAttribute('href');
    buttonElement.innerText = 'Open in Tower';
    buttonElement.setAttribute('aria-label', buttonElement.getAttribute('aria-label').replace('GitHub Desktop', 'Tower'));
    buttonElement.removeAttribute('data-open-app');

    buttonElement.addEventListener('click', function(event) {
        event.preventDefault();

        var repoModalElement = buttonElement.parentElement.parentElement;
        var inputElements = repoModalElement.querySelectorAll('input[type="text"]');
        var isSSH = repoModalElement.classList.contains('on');

        var activeInputElement = inputElements[isSSH ? 1 : 0];

        window.location.href = 'gittower://openRepo/' + encodeURI(activeInputElement.value);
    });
}());

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

No branches or pull requests

3 participants