From 139715f66e3fc4731f9b6185c449c67dd54c2c12 Mon Sep 17 00:00:00 2001 From: aprzn Date: Mon, 3 Jul 2023 17:08:36 -0400 Subject: [PATCH] wrote a bunch about thethirdcan --- content/thethirdcan.md | 64 ++++++++++++++++++++++++++++++++++++++++++ sass/style.scss | 15 ++++++++++ templates/base.html | 1 + 3 files changed, 80 insertions(+) create mode 100644 content/thethirdcan.md diff --git a/content/thethirdcan.md b/content/thethirdcan.md new file mode 100644 index 0000000..da0229b --- /dev/null +++ b/content/thethirdcan.md @@ -0,0 +1,64 @@ ++++ +title = "the third can" ++++ + +i made a browser extension with [theki](https://theki.club) and contributions from [sandvich](https://sandvich.xyz). it adds lots of useful features to [TwoCans](https://twocansandstring.com). + +i figure that in addition to sharing how you can use the extension for yourself, i could talk a bit here about how it works internally. but first, the obligatory: + +## links +- [chrome web store](https://chrome.google.com/webstore/detail/the-third-can/leimkcdimeemfabpjbjhiccaolpdbjng) +- [mozilla add-ons](https://addons.mozilla.org/en-US/firefox/addon/the-third-can/) +- [github](https://github.com/aprzn123/TheThirdCan/#readme) + +i'd list the features here, but they're already listed right there on the readme so i'm not going to repeat myself (as much) + +you can also run the development build (instructions on the github readme). it's less stable and doesn't persist across browser restarts (at least on firefox), but it gets new features sooner than the standard methods. not recommended unless you want to help test new features. + +## ok, rambling time +now that we've gotten the big stuff out of the way, i can just talk about whatever here. expect comments about how thethirdcan works, planned features, etc. do not expect incredibly high quality writing. will probably be updated periodically as i have Thoughts. + +### script injection +so here's the deal: some features of thethirdcan, such as the skip button confirmation prompt, require access to objects in the javascript runtime of the webpage (notably the `TC` object that has a lot of functions for answering, skipping, etc). for security reasons, the extension code cannot interact directly with this namespace, so we need a way to be able to write code that runs within the same namespace. + +at the beginning, this was simple. i could just write a script in a separate file, and use the extension to add a new `