Skip to content

Instantly share code, notes, and snippets.

@KevinNitroG
Last active November 10, 2024 11:51
Show Gist options
  • Save KevinNitroG/35df1b7168a5b509258c02b1698921ad to your computer and use it in GitHub Desktop.
Save KevinNitroG/35df1b7168a5b509258c02b1698921ad to your computer and use it in GitHub Desktop.
Delete all stylus styles
  • Open stylus manager page
  • F12
  • Paste this script in the console

    Or add this snippet. Then Ctrl + Enter

    async function deleteStyle() {
      const deleteBtn = document.querySelector('p.actions > a.delete');
      if (!deleteBtn) {
        return false
      }
      deleteBtn.click();
      await new Promise((resolve) =>
        setTimeout(() => {
          document.querySelector('#message-box-buttons > button:nth-child(1)').click();
          resolve();
        }, 10),
      );
      return true;
    }
    
    async function main() {
      while (deleteStyle()) {
        await new Promise((resolve) => setTimeout(resolve, 100));
      }
    }
    
    main();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment