Last active
December 17, 2020 17:51
-
-
Save nedgar/b5d93d9bb8812fece46c55061f580e9c to your computer and use it in GitHub Desktop.
Roam Research roam/js extension to show "Roam: " as browser window prefix
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
- Copy/paste the JS code block below under a `{{[[roam/js]]}}` block on any page (import does not format it correctly). | |
- Doc on roam/js extensions: https://roamresearch.com/#/app/help/page/3l_9j6aAv | |
- {{[[roam/js]]}} | |
- ```javascript | |
function checkTitle() { | |
const t = document.title, r = 'Roam: '; | |
if (!t.startsWith(r)) { document.title = r + t; } | |
}; | |
new MutationObserver(checkTitle).observe( | |
document.querySelector('title'), | |
{ characterData: true, childList: true } | |
); | |
checkTitle();``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment