File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change
1
+ // ==UserScript==
2
+ // @name GitHub Autoload Large Diffs
3
+ // @namespace http://github.com/softwareengineerprogrammer
4
+ // @version 0.1
5
+ // @description I want to see large diffs
6
+ // @author softwareengineerprogrammer
7
+ // @match https://github.com/*/*/pull/*/files*
8
+ // @grant none
9
+ // @updateURL https://softwareengineerprogrammer.github.io/userscripts/gh-autoload-large-diffs.user.js
10
+ // @downloadURL https://softwareengineerprogrammer.github.io/userscripts/gh-autoload-large-diffs.user.js
11
+ // ==/UserScript==
12
+
13
+ ( function ( ) {
14
+ 'use strict' ;
15
+
16
+ setTimeout ( function ( ) {
17
+ document . querySelectorAll ( 'button.load-diff-button' ) . forEach ( it => {
18
+ let doLoad = true ;
19
+ try {
20
+ let viewedElt = it . parentElement . parentElement . parentElement . parentElement . parentElement . parentElement . querySelector ( 'form.js-toggle-user-reviewed-file-form input[value="viewed"]' )
21
+ let isMarkedViewed = viewedElt . checked || false ;
22
+ console . log ( it , viewedElt , isMarkedViewed )
23
+ doLoad = ! isMarkedViewed
24
+ } catch ( e ) {
25
+ console . warning ( 'Failed determine whether large diff file has been marked as viewed' , e )
26
+ }
27
+
28
+ if ( doLoad ) {
29
+ it . click ( )
30
+ }
31
+ } ) ;
32
+ } , 2000 ) ;
33
+ } ) ( ) ;
You can’t perform that action at this time.
0 commit comments