Skip to content

Instantly share code, notes, and snippets.

@nedgar
Last active December 17, 2020 17:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nedgar/b5d93d9bb8812fece46c55061f580e9c to your computer and use it in GitHub Desktop.
Save nedgar/b5d93d9bb8812fece46c55061f580e9c to your computer and use it in GitHub Desktop.
Roam Research roam/js extension to show "Roam: " as browser window prefix
- 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