Skip to content

Commit

Permalink
Monorail: Fix complete breakage when the user is not signed in.
Browse files Browse the repository at this point in the history
When the user isn't signed in, there is no star control. Previously, the script wasn't accounting for this and failed with an exception before doing anything useful.
Fixes #12.
  • Loading branch information
jcsteh committed Mar 13, 2017
1 parent 6c2b1d9 commit 60776d8
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions MonorailA11yFixes.user.js
Expand Up @@ -3,9 +3,9 @@
// @namespace http://axSGrease.nvaccess.org/
// @description Improves the accessibility of Google Code.
// @author James Teh <jamie@nvaccess.org>
// @copyright 2016 NV Access Limited
// @copyright 2016-2017 NV Access Limited
// @license GNU General Public License version 2.0
// @version 2016.1
// @version 2017.1
// @include https://bugs.chromium.org/p/*/issues/*
// ==/UserScript==

Expand Down Expand Up @@ -48,5 +48,10 @@ var observer = new MutationObserver(function(mutations) {
observer.observe(document, {attributes: true,
subtree: true, attributeFilter: ["src"]});

fixStar(document.getElementById("star"));
makeHeadings();
function initial() {
var star = document.getElementById("star");
if (star)
fixStar(star);
makeHeadings();
}
initial();

0 comments on commit 60776d8

Please sign in to comment.