Skip to content

Instantly share code, notes, and snippets.

@lokothodida
Last active October 20, 2021 10:11
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save lokothodida/b1cbb18c074957575115bfa06230bf71 to your computer and use it in GitHub Desktop.
Save lokothodida/b1cbb18c074957575115bfa06230bf71 to your computer and use it in GitHub Desktop.
Small bookmarklet to help change app drawer icons for Chrome OS web apps
  • Create a bookmark with the following text in the URL field:
javascript:(function() {
  if (!document.querySelectorAll('link[rel*=icon]').length) {
      const link = document.createElement('link');
      link.rel   = 'icon';
      document.querySelector('head').appendChild(link);
  }

  const links = document.querySelectorAll('link[rel*=icon]');
  const href  = prompt('Enter your new shelf icon\'s URL');
  href && links.forEach((link) => link.href = href);
})();
  • Click the bookmark on your desired page
  • Enter the desired shelf icon URL and click OK.
  • Add the page to your shelf.

Thanks to /u/dimethylarginine for discovering this trick.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment