Skip to content

Instantly share code, notes, and snippets.

@magnetikonline
Created November 20, 2018 12:01
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save magnetikonline/2b5fb432aec79c2da357765a8bb21d27 to your computer and use it in GitHub Desktop.
Save magnetikonline/2b5fb432aec79c2da357765a8bb21d27 to your computer and use it in GitHub Desktop.
GitHub pull request timeline toggle "force-pushed" events bookmarklet.

GitHub pull request toggle "force-pushed" events bookmarklet

Since November 2018, GitHub have started to display forced push events to pull request page timelines. This bookmarklet will toggle display of these events if they are getting in the way of meaningful commits.

Add the code below as the URL of a new bookmark:

javascript:((d)=>{if(d.getElementById('nuke-fp')==null){let e=d.createElement('style');e.id='nuke-fp';e.innerHTML='.nuke-fp{display:none}';d.getElementsByTagName('head')[0].appendChild(e)}for(let e of Array.from(d.querySelectorAll('.discussion-timeline .discussion-item-head_ref_force_pushed'))){e.classList.toggle('nuke-fp')}})(document)

Tested with Chrome 70.0.3538.102.

Uncompressed source provided below.

((d) => {
if (d.getElementById('nuke-fp') == null) {
let e = d.createElement('style');
e.id = 'nuke-fp';
e.innerHTML = '.nuke-fp{display:none}';
d.getElementsByTagName('head')[0].appendChild(e)
}
for (let e of Array.from(d.querySelectorAll('.discussion-timeline .discussion-item-head_ref_force_pushed'))) {
e.classList.toggle('nuke-fp');
}
})(document);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment