Skip to content

Instantly share code, notes, and snippets.

@fabienhinault
Last active October 18, 2021 13:33
Show Gist options
  • Save fabienhinault/213b79479c51066b1730295b1c11a65b to your computer and use it in GitHub Desktop.
Save fabienhinault/213b79479c51066b1730295b1c11a65b to your computer and use it in GitHub Desktop.
filter for gitlab MRs
// @match https://mygitlab.com/groups/mygroup/-/merge_requests?*
(function() {
'use strict';
const names = ["alice", "bernard", "etc."];
const projects = ["save-world", "cure-all-diseases"];
const selectors = names.map(name => `div.issuable-info-container div.issuable-info span.issuable-authored a[data-username="${name}"]`)
.concat(projects.map(project => `div.issuable-info-container div.issuable-main-info div.merge-request-title span.merge-request-title-text a[href*="/${project}/"]`));;
[].filter.call(document.querySelectorAll('main#content-body > ul > li'), li => !selectors.find(selector => li.querySelector(selector))).forEach(li => li.remove());
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment