Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Bookmarklet to hide rows on various source hosting sites
var url = window.location.href;
var searchTextToIgnore = prompt('Enter text to ignore:');
if (url.match(/bitbucket/)) {
$('h1:contains(' + searchTextToIgnore + ')').closest('section').hide();
} else if (url.match(/gitlab/)) {
$('.diff-header span:contains(' + searchTextToIgnore + ')').parent().parent().hide();
} else {
alert(url + " doesn't match any known sites.");

This comment has been minimized.

Copy link
Owner Author

drmohundro commented Jan 24, 2016

This is just a simple script that can hide sections within a pull request on (currently) GitLab or Bitbucket. As an example, if there is generated code that is checked in, it might be useful to ignore that while reviewing the pull request. This script prompts the user for a partial string match so that it can hide those sections.

It currently assumes jQuery is loaded, but it wouldn't be hard to remove that dependency.

I used this Bookmarklet Creator to convert this into a bookmarklet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.