Skip to content

Instantly share code, notes, and snippets.

@georapbox
Forked from mikeconley/Firefox tabs script.md
Created February 4, 2022 15:52
Show Gist options
  • Save georapbox/4d822b67e9574fcb54e28eeed3528925 to your computer and use it in GitHub Desktop.
Save georapbox/4d822b67e9574fcb54e28eeed3528925 to your computer and use it in GitHub Desktop.
A script you can execute in your Browser Console to generate a string representation of your tabs!
/**
* If you have your Browser Console command-line enabled[1], you can paste this string
* in to generate an emoji representation of your tabs, which will automatically be copied
* into your clipboard.
*
* WARNING: Be VERY careful with what you put into your Browser Console - don't run
* any scripts in there that you yourself don't understand.
* This script was written by Nicolas Chevobbe (@nicolaschevobbe)
*
* [1]: https://developer.mozilla.org/en-US/docs/Tools/Browser_Console#browser_console_command_line
*/
copy("Not Wordle, just my Firefox tabs:\n" + gBrowser.tabs.map(tab => tab.pinned ? `🟪` : tab.getAttribute("pending") ? `🟨` : `🟩` )
.reduce((acc, curr) => {
if (acc.at(-1).length == 10) {
acc.push("");
}
acc[acc.length - 1] += curr;
return acc;
}, [""]).join("\n") + "\nhttps://bit.ly/3L2Wm46")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment