# CSGT: Back button, save syncing, variable notifications extension for Firefox

**URL:** <https://forum.choiceofgames.com/t/csgt-back-button-save-syncing-variable-notifications-extension-for-firefox/133937>\
**Category:** General\
**Created:** [March 14, 2023, 10:22pm UTC](https://forum.choiceofgames.com/t/csgt-back-button-save-syncing-variable-notifications-extension-for-firefox/133937 "2023-03-14T22:22:30Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![alecto](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/alecto/32/243525_2.png) [@alecto](https://forum.choiceofgames.com/u/alecto)\
**Post date:** [March 14, 2023, 10:22pm UTC](https://forum.choiceofgames.com/t/csgt-back-button-save-syncing-variable-notifications-extension-for-firefox/133937/1 "2023-03-14T22:22:30Z")

</div>

Hi folks,  
I’ve been working on developing a [Firefox extension](https://addons.mozilla.org/en-US/firefox/addon/cs-game-tools/) to add a bunch of functionality to Choicescript games, including

- A back button;
- notifications on variable changes;
- in-browser viewing of the exact code responsible for a particular line or section of text;
- autosaving on dashingdon/moody.ink;
- transferring saves across browsers;
- assorted animation improvements/fixes;
- and probably a couple of other things that I’m forgetting.

I’ve mostly been promoting this on my ~~[tumblr](https://www.tumblr.com/blog/thesoulofthebeautiful)~~ [updated link to csgt specific tumblr](https://www.tumblr.com/csgt), and to be honest I’ll probably continue to do most communication about this there but I thought I’d make a topic about it here in case anybody’s interested! Please reach out if you have any issues with it, or if there’s any other features that you’d appreciate!

EDIT: Forgot to include the [Github link](https://github.com/lawruble13/cs-game-tools)!

---

<div class="post-metadata">

**Author:** ![EvilChani](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/evilchani/32/210661_2.png) [@EvilChani](https://forum.choiceofgames.com/u/EvilChani)\
**Post date:** [March 14, 2023, 10:27pm UTC](https://forum.choiceofgames.com/t/csgt-back-button-save-syncing-variable-notifications-extension-for-firefox/133937/2 "2023-03-14T22:27:58Z")

</div>

Oh hell yeah! I’m going to try this. And as much as I hate tumblr, I’ll be keeping up with yours. I’ll try this out later tonight after I finish work!

Thank you!!!

---

<div class="post-metadata">

**Author:** ![cup\_half\_empty](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/cup_half_empty/32/273983_2.png) [@cup\_half\_empty](https://forum.choiceofgames.com/u/cup_half_empty)\
**Post date:** [March 14, 2023, 11:21pm UTC](https://forum.choiceofgames.com/t/csgt-back-button-save-syncing-variable-notifications-extension-for-firefox/133937/3 "2023-03-14T23:21:53Z")

</div>

**No. Freaking. Way.**

![Mike Myers Evil Laugh](https://media1.giphy.com/media/xl5QdxfNonh3q/giphy.gif?cid=6c09b952f14204d41a67c26601df37e150db546a8f98fc84&rid=giphy.gif&ct=g)

I am working on something similar, but as an extension for Chrome. What are the odds? I’m including these 2 features, plus a “generate feedback” that creates a report text from template with the file and approximate line number that people can post straight to the forum here and help the author better locate the issue.

> [@alecto](#):
>
> - notifications on variable changes;
> - in-browser viewing of the exact code responsible for a particular line or section of text;

![High Five GIF by Clarke University](https://media1.giphy.com/media/jok0x4w25dz14vfoXj/giphy.gif?cid=6c09b952afc78f9299ae600ebd3a6aee31460e6452b100fd&rid=giphy.gif&ct=g)

---

<div class="post-metadata">

**Author:** ![alecto](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/alecto/32/243525_2.png) [@alecto](https://forum.choiceofgames.com/u/alecto)\
**Post date:** [March 14, 2023, 11:28pm UTC](https://forum.choiceofgames.com/t/csgt-back-button-save-syncing-variable-notifications-extension-for-firefox/133937/4 "2023-03-14T23:28:30Z")

</div>

Oh, that’s awesome! I’ve been meaning to try porting this over to Chrome as well, but I haven’t wanted to figure out Manifest V3 so I keep procrastinating 😅 Automatically composing the feedback report seems like a fantastic feature, I’d love to see your extension once it’s ready!

---

<div class="post-metadata">

**Author:** ![ClaimedMinotaur](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/claimedminotaur/32/181115_2.png) [@ClaimedMinotaur](https://forum.choiceofgames.com/u/ClaimedMinotaur)\
**Post date:** [March 14, 2023, 11:34pm UTC](https://forum.choiceofgames.com/t/csgt-back-button-save-syncing-variable-notifications-extension-for-firefox/133937/5 "2023-03-14T23:34:04Z")

</div>

Yeeeeeees. Let the save system revolution begin!  
 ![raccoon-yes](https://global.discourse-cdn.com/choiceofgames/original/3X/5/a/5a3531c2086628b4225b78e831b3bccf1b115015.gif)

---

<div class="post-metadata">

**Author:** ![cup\_half\_empty](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/cup_half_empty/32/273983_2.png) [@cup\_half\_empty](https://forum.choiceofgames.com/u/cup_half_empty)\
**Post date:** [March 14, 2023, 11:43pm UTC](https://forum.choiceofgames.com/t/csgt-back-button-save-syncing-variable-notifications-extension-for-firefox/133937/6 "2023-03-14T23:43:07Z")

</div>

I haven’t done too much yet except for a few scripts that I run straight on the browser to test some hypotheses. I don’t even have a repo yet.

I’m still trying to figure out how to map the source to the generated page. I have a makeshift solution but I’m not 100% happy with it. I’m curious how you solved that. 😁

---

<div class="post-metadata">

**Author:** ![alecto](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/alecto/32/243525_2.png) [@alecto](https://forum.choiceofgames.com/u/alecto)\
**Post date:** [March 15, 2023, 12:08am UTC](https://forum.choiceofgames.com/t/csgt-back-button-save-syncing-variable-notifications-extension-for-firefox/133937/7 "2023-03-15T00:08:44Z")

</div>

That part was a fun challenge! The source for my code is open, so you’re welcome to look through and borrow any bits that looks useful! (You might find [this section](https://github.com/lawruble13/cs-game-tools/blob/59b118b6c67c9ccfa7138f87dabc3aa7a4e4e77f/src/inject/script/sceneModifications.js#L122-L144) useful for that particular problem.) I think my solution can still use a bunch of work, but for now it works.

---

<div class="post-metadata">

**Author:** ![cup\_half\_empty](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/cup_half_empty/32/273983_2.png) [@cup\_half\_empty](https://forum.choiceofgames.com/u/cup_half_empty)\
**Post date:** [March 15, 2023, 12:39am UTC](https://forum.choiceofgames.com/t/csgt-back-button-save-syncing-variable-notifications-extension-for-firefox/133937/8 "2023-03-15T00:39:08Z")

</div>

Oh, wow, accumulate the lines inside `printLine`, that’s so simple.

![](https://media.giphy.com/media/E7ar3Qo0bZi3QXS2zK/giphy.gif)

---

<div class="post-metadata">

**Author:** ![EvilChani](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/evilchani/32/210661_2.png) [@EvilChani](https://forum.choiceofgames.com/u/EvilChani)\
**Post date:** [March 15, 2023, 2:50am UTC](https://forum.choiceofgames.com/t/csgt-back-button-save-syncing-variable-notifications-extension-for-firefox/133937/9 "2023-03-15T02:50:05Z")

</div>

This works like a freaking _charm_. I was waiting on a db restore to run and started a game. Everything works so far. No bugs at all! I’ll give it a thorough testing and let you know if I run into anything. The fact that it scrolls to the choices you’re on when you click “Code” is an especially nice trick!

@cup_half_empty If you get it working for Chrome, I’ll grab yours, too. And be happy to test it.

This is just so awesome!! Saves a lot of back and forth with the code. I’d love it if you updated here as well as tumblr, btw. But I get it if you don’t have time.

---

<div class="post-metadata">

**Author:** ![alecto](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/alecto/32/243525_2.png) [@alecto](https://forum.choiceofgames.com/u/alecto)\
**Post date:** [March 15, 2023, 3:01am UTC](https://forum.choiceofgames.com/t/csgt-back-button-save-syncing-variable-notifications-extension-for-firefox/133937/10 "2023-03-15T03:01:08Z")

</div>

I’m so glad it’s working well for you! Another fun trick is if you highlight some text on the page before clicking the “Code” button, the code responsible for generating that text will be highlighted (it will also scroll to that code by default)! I’ve found it helpful when trying to track the flow through particularly dense passages.

I’m happy to update here as well as the Tumblr, it’s honestly a better avenue for this sort of stuff anyway!

---

<div class="post-metadata">

**Author:** ![alecto](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/alecto/32/243525_2.png) [@alecto](https://forum.choiceofgames.com/u/alecto)\
**Post date:** [March 27, 2023, 8:50pm UTC](https://forum.choiceofgames.com/t/csgt-back-button-save-syncing-variable-notifications-extension-for-firefox/133937/11 "2023-03-27T20:50:47Z")

</div>

Hey folks! It’s been a minute, but I’ve got a new update just about ready! Added features in this new update are:

- Ability to make custom saves in CSGT
- Ability to delete CSGT saves you’re not using
- Ability to load CSGT saves directly
- Increased compression of CSGT saves (~52% → ~40%)
- Use IndexedDB instead of localStorage

That last point is actually super important and why I’m posting prior to publishing the update, as it has the potential to be slightly disruptive. It’s important because it can entirely eliminate the QuotaExceeded errors that you may have seen when playing/loading some games (especially paid games, as they cache the scene data). I don’t know if many other people encounter this issue, but I certainly have and find it very annoying. It’s slightly disruptive because any data that is stored while CSGT is active will now be invisible if it isn’t active. This is only really relevant when playing games published on [choiceofgames.com](http://choiceofgames.com), so if you play a game while using CSGT and later disable CSGT then your save will be lost.

I’m not sure how much of an issue this would be for people, so I posted a [poll on the CSGT tumblr](https://www.tumblr.com/csgt/712978843341832192/the-next-version-of-csgt-will-switch-from-using?source=share) to ask about it, and I’d love to hear any feedback you may have here.

---

<div class="post-metadata">

**Author:** ![ElliWoelfin](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/elliwoelfin/32/259157_2.png) [@ElliWoelfin](https://forum.choiceofgames.com/u/ElliWoelfin)\
**Post date:** [March 27, 2023, 10:42pm UTC](https://forum.choiceofgames.com/t/csgt-back-button-save-syncing-variable-notifications-extension-for-firefox/133937/12 "2023-03-27T22:42:56Z")

</div>

Stupid ask, any chance on making a version for Chromium-based browsers? Or is only gonna be Firefox forever (or at least the foreseeable future)?

---

<div class="post-metadata">

**Author:** ![alecto](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/alecto/32/243525_2.png) [@alecto](https://forum.choiceofgames.com/u/alecto)\
**Post date:** [March 27, 2023, 11:28pm UTC](https://forum.choiceofgames.com/t/csgt-back-button-save-syncing-variable-notifications-extension-for-firefox/133937/13 "2023-03-27T23:28:09Z")

</div>

Not a stupid ask at all! Chrome (and chromium-based browsers generally) have presented something of a challenge for me. Firstly there’s some features which behave differently across the browsers, including some syntax which needs to change for it to work on Chrome. On top of that Manifest V3 is a headache, and in fact I used Firefox specifically because Chrome kinda sucks to develop for.

All that said I would actually like to get this working on Chrome, it’s just kind of a daunting task that I haven’t wanted to tackle yet. I don’t have an estimate on when I might do that, but I’ll definitely post here when I get to it!

---

<div class="post-metadata">

**Author:** ![alecto](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/alecto/32/243525_2.png) [@alecto](https://forum.choiceofgames.com/u/alecto)\
**Post date:** [March 28, 2023, 6:31am UTC](https://forum.choiceofgames.com/t/csgt-back-button-save-syncing-variable-notifications-extension-for-firefox/133937/14 "2023-03-28T06:31:35Z")

</div>

I’ve just published the newest version 1.6.0! It should update automatically soon after it goes live. As mentioned, the QuotaExceeded error has been entirely resolved by switching to use IndexedDB. Additionally, you can now make, load, and import custom saves from in any game (casually adding saves to games published via CoG), although the interface kinda sucks right now so I think I’ll probably revisit that in the near future.

I had said that the compression rate was increased, but I discovered within the last couple of hours that the library I was using had a pretty severe memory leak. I wanted to put out what I had so y’all can start playing around with that, and I can continue running my head into this particular wall some other day.

Please let me know if you encounter any bugs! I would also love feedback if there’s other features that you would find useful.

---

<div class="post-metadata">

**Author:** ![Naldek](https://avatars.discourse-cdn.com/v4/letter/n/848f3c/32.png) [@Naldek](https://forum.choiceofgames.com/u/Naldek)\
**Post date:** [March 28, 2023, 7:00am UTC](https://forum.choiceofgames.com/t/csgt-back-button-save-syncing-variable-notifications-extension-for-firefox/133937/15 "2023-03-28T07:00:54Z")

</div>

> [@alecto](#):
>
> Ability to make custom saves in CSGT

> [@alecto](#):
>
> entirely eliminate the QuotaExceeded errors

I can’t thank you enough for both of that. Would you still lose your saves if you erase your browser cookies ?

---

<div class="post-metadata">

**Author:** ![alecto](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/alecto/32/243525_2.png) [@alecto](https://forum.choiceofgames.com/u/alecto)\
**Post date:** [March 28, 2023, 7:13am UTC](https://forum.choiceofgames.com/t/csgt-back-button-save-syncing-variable-notifications-extension-for-firefox/133937/16 "2023-03-28T07:13:00Z")

</div>

Excellent question! The items that were stored in localStorage (now stored in IndexedDB) will still be cleared if you clear your browser history. However, both your autosaves and your custom saves are persisted in the extension storage, and unless I’m very mistaken they should remain when you clear your cookies.

---

<div class="post-metadata">

**Author:** ![Zahr](https://avatars.discourse-cdn.com/v4/letter/z/aeb1de/32.png) [@Zahr](https://forum.choiceofgames.com/u/Zahr)\
**Post date:** [March 28, 2023, 8:49am UTC](https://forum.choiceofgames.com/t/csgt-back-button-save-syncing-variable-notifications-extension-for-firefox/133937/17 "2023-03-28T08:49:47Z")

</div>

This is great! Doubly so for testing games. Could you add an option to disable animations for notifications and the code window, so that they appear/go away instantaneously?

---

<div class="post-metadata">

**Author:** ![Queen\_Zelda](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/queen_zelda/32/167240_2.png) [@Queen\_Zelda](https://forum.choiceofgames.com/u/Queen_Zelda)\
**Post date:** [March 28, 2023, 9:23am UTC](https://forum.choiceofgames.com/t/csgt-back-button-save-syncing-variable-notifications-extension-for-firefox/133937/18 "2023-03-28T09:23:44Z")

</div>

It would be so amazing to get the add-on for android as well, pretty please? 😍

---

<div class="post-metadata">

**Author:** ![alecto](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/alecto/32/243525_2.png) [@alecto](https://forum.choiceofgames.com/u/alecto)\
**Post date:** [March 28, 2023, 3:22pm UTC](https://forum.choiceofgames.com/t/csgt-back-button-save-syncing-variable-notifications-extension-for-firefox/133937/19 "2023-03-28T15:22:27Z")

</div>

> [@Zahr](#):
>
> This is great! Doubly so for testing games. Could you add an option to disable animations for notifications and the code window, so that they appear/go away instantaneously?

Yes, absolutely! That’s an excellent idea, and I’ve added it to the list of tasks for 1.6.1.

> [@Queen\_Zelda](#):
>
> It would be so amazing to get the add-on for android as well, pretty please? 😍

So funny story, it does actually support Android currently (that’s where I primarily use it actually), but Mozilla has some stupid rules around add-ons for Android. Namely, there’s a very _very_ limited whitelist of addons that you can install on the basic Firefox for Android. However, on Firefox Nightly and Firefox for Android Beta you can install it using a custom collection, and they describe the process [here](https://blog.mozilla.org/addons/2022/12/15/new-extensions-available-now-on-firefox-for-android-nightly/). A quick summary of that process (assuming you’ve installed Firefox Nightly / Beta):

1. Create a collection with whatever extensions you would like on Firefox for Android Beta
2. Note the number and name in the collection URL
3. In Firefox Nightly / Beta, go to Custom Add-on collection and input the number and name.
4. Your extensions should now be installed!

It’s a major pain in the ass, but unfortunately it’s totally out of my hands. I have added some specific support for mobile, but it’s pretty much just enough to get it working as until Mozilla changes their policies my hands are pretty much tied. Also note that cross-browser syncing doesn’t work on mobile (again Mozilla), but it does work between games on the same browser. So for example if you made a save for TWC 2 on mobile, you could import that into TWC 3 (or the demo!) on mobile. I want to add export to/import from a file functionality so I can at least somewhat bypass that restriction of Firefox, so that might also happen in 1.6.1 (my numbering is extremely haphazard, sorry y’all).

Also real quick aside about TWC 2 saves: if you try to load a save from the end of TWC 2 into TWC 2, you can export on the page where it says “Unfortunately, this save was created […]” and that’s a valid import into the TWC 3 demo, just import immediately after the character creation is complete!

---

<div class="post-metadata">

**Author:** ![Queen\_Zelda](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/queen_zelda/32/167240_2.png) [@Queen\_Zelda](https://forum.choiceofgames.com/u/Queen_Zelda)\
**Post date:** [April 2, 2023, 11:49am UTC](https://forum.choiceofgames.com/t/csgt-back-button-save-syncing-variable-notifications-extension-for-firefox/133937/20 "2023-04-02T11:49:19Z")

</div>

only a question so please no execution of poor me lol can we change the stats of our characters as well? make them better? and if yes, how? I’m a noob when it comes to things like that xD

[Next page](https://forum.choiceofgames.com/t/csgt-back-button-save-syncing-variable-notifications-extension-for-firefox/133937.md?page=2)
