Skip to content

Commit 60776d8

Browse files
committed
Monorail: Fix complete breakage when the user is not signed in.
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.
1 parent 6c2b1d9 commit 60776d8

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

MonorailA11yFixes.user.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
// @namespace http://axSGrease.nvaccess.org/
44
// @description Improves the accessibility of Google Code.
55
// @author James Teh <jamie@nvaccess.org>
6-
// @copyright 2016 NV Access Limited
6+
// @copyright 2016-2017 NV Access Limited
77
// @license GNU General Public License version 2.0
8-
// @version 2016.1
8+
// @version 2017.1
99
// @include https://bugs.chromium.org/p/*/issues/*
1010
// ==/UserScript==
1111

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

51-
fixStar(document.getElementById("star"));
52-
makeHeadings();
51+
function initial() {
52+
var star = document.getElementById("star");
53+
if (star)
54+
fixStar(star);
55+
makeHeadings();
56+
}
57+
initial();

0 commit comments

Comments
 (0)