Skip to content

Instantly share code, notes, and snippets.

@Braunson
Last active March 18, 2022 21:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Braunson/66b87ab02396bccc3495fccda5430559 to your computer and use it in GitHub Desktop.
Save Braunson/66b87ab02396bccc3495fccda5430559 to your computer and use it in GitHub Desktop.
Auto ignore whitespace in GitHub Pull Requests
// ==UserScript==
// @name GitHub Auto Click Ignore Whitespaces in PRs
// @namespace https://braunson.ca
// @version 1.0
// @description Auto click enable whitespace by default on GitHub Pull Requests
// @author Braunson Yager
// @match https://github.com/*/*/pull/*
// @grant none
// @downloadURL https://gist.githubusercontent.com/Braunson/66b87ab02396bccc3495fccda5430559/raw/07c93d2907769768a2e5554e36d44726dea22a3d/github_auto_enable_ignore_whitespace?v=1.0
// ==/UserScript==
(function() {
'use strict';
for (let link of document.getElementsByClassName('tabnav-tab')) {
if (link.nodeName === 'A' && link.href.endsWith('files')) {
link.href += '?w=1';
link.click();
}
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment