Created
September 23, 2019 12:07
-
-
Save tobiashm/f2e6827dccc90bd37213498992a74325 to your computer and use it in GitHub Desktop.
Safari userscript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.addEventListener('load', function() { | |
if (!document.location.href.startsWith('https://app.clubhouse.io/')) { return; } | |
function isDropdownNode(node) { | |
return node.nodeType === Node.ELEMENT_NODE && node.classList.contains('dropdown'); | |
} | |
document.addEventListener('DOMNodeInserted', function(event) { | |
var insertedNode = event.target; | |
if (!isDropdownNode(insertedNode)) return; | |
Array.from(insertedNode.querySelectorAll('input[class^="git-branch"]')).forEach(function (input) { | |
input.value = input.value.replace(/\b\w+\/ch(\d+)\//, 'ch$1/'); | |
}); | |
}, false); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment