gkoberger / BugzillaJS

A userscript that adds additional functionality to bugzilla
https://addons.mozilla.org/en-US/firefox/addon/bugzillajs/
43 stars 18 forks source link

Cannot figure out how to install BugzillaJS extension for local development #103

Closed cvan closed 6 years ago

cvan commented 9 years ago

I tried following the README. I installed omnium, but I couldn't figure out all the moving pieces.

https://github.com/gkoberger/BugzillaJS#developing-the-add-on-osx-only

./builder.js bugzillajs opened Chrome (because it's my default browser) to output/index.html, but then installing the extension did not seem to work.

viewing view-source:file:///opt/omnium/bugzillajs/output/omnium/omnium_widget.js:


(function() {
    var info = {},
        browsers = ["Firefox", "Chrome"],
        elements = document.getElementsByTagName('a');

    for (var i = 0; i < browsers.length; i++) {
        var browser = browsers[i];
        if (navigator.userAgent.indexOf(browser) > 0) {
            info.browser = browser;
            info.version = parseFloat(navigator.userAgent.substring(navigator.userAgent.indexOf(browser) + browser.length + 1));
        }
    }

    if (info.browser == "Firefox") {
        info.browser += " " + info.version;
        if (info.version < 4) {
            info.type = "greasemonkey";
            info.suffix = ".user.js";
        } else {
            info.type = "jetpack";
            info.suffix = ".xpi";
        }
    } else if(info.browser == "Chrome") {
        info.type = "chrome";
        info.suffix = ".user.js";
    }

    for (var i = 0; i < elements.length; i++) {
        if (elements[i].className == "omnium_addon") {
            var el = elements[i];
            folder = el.getAttribute('data-folder');
            el.setAttribute('href', omnium_folder + "/" + folder + info.suffix);
            el.getElementsByTagName('span')[0].innerHTML = info.browser;
        }
    }
})();

does this actually still work? what are the steps required to be able to do local dev?

gkoberger commented 9 years ago

I imagine a ton has changed since I wrote this a few years ago. @Rik, and ideas?

rik commented 9 years ago

I've actually never tested on Chrome so it might be completely broken.

mnoorenberghe commented 6 years ago

Omnium is no longer needed as this is a web extension. It currently uses one or two Firefox-specific features but otherwise can probably work in Chrome. The readme was updated with new instructions.