irvinm / TST-Lock

Protect your tabs in TST by replacing the close "X" with a lock. Toggle via "Ctrl + Shift + Left Mouse Click"
https://addons.mozilla.org/en-US/firefox/addon/tst-lock/
MIT License
1 stars 0 forks source link

Evaluate if the initial call to registerSelfToTST() is needed #1

Closed irvinm closed 4 years ago

irvinm commented 4 years ago

There is an initial call, then I added another call after the "ready" message is sent.

It seems to work now, but wondering if the first call is really needed or not.

irvinm commented 4 years ago

Look at TST doc example: https://github.com/piroor/treestyletab/blob/trunk/doc/boilerplate-helper-background.js

It is more async vs. sync with more error checking.

irvinm commented 4 years ago

As of v1.1.1, I have added some retry logic around registerSelfToTST() with check-in: https://github.com/irvinm/TST-Lock/commit/c5f3c928fddbeee2cdd2d83e763f67b4a58d847d. It is clear that some calls to register to TST are made before TST is fully loaded and the try\catch logic has to take that into account and retry registering to TST until it is successful.