You are browsing as a guest. Sign up (or log in) to start making projects!

3h 56m 21s logged

Storytime!

I feel like every project I make I face a similar set of limitations. So, let’s make a recap of the first stage of this project!

Very lucky unlucky day

As usual, I’m facing API issues. I enjoy making app extensions less and less due to restrictive rules they enforce. To make it clear, initially I had a specific set of plans at which my extension would excel compared to others:

  • No timeout logic, instead handling tab switching based on specific key inputs (this will be important later)
  • Save/load tab history from storage for access after restoring tabs
  • Unlimited tab history
  • Indication of the tab that will be switched
  • Ctrl+Tab override

However, only one of those I was able to accomplish, with another one planned for the second stage of this project:

  • Unlimited tab history
  • Ctrl+Tab (planned for later)

Spending a lot of time, I at least made sure the extension functions well, with no memory termination and with each window having its own tab access history.

Why other things failed?

Well at first, Manifest V3 greatly reduced the amount of stuff that can be accessed by Chrome’s API. On top of that, chrome:// pages can’t be anyhow monitored or modified due to essential safety. This posed many issues, one of which was the inability to detect the press of a modifier key, so I had to go one of two ways:

  1. Build an OS-level keylogger which communicates with the extension through an open bridge, but I turned it down because:
    • It’s a threat to security
    • Python on the host computer is required (in order for me to retain a single codebase for each platform)
  2. Or just resort back to carefully adjusted keypress timeouts

I chose the second option.
I spent a whole day trying to save and load tab history, but the problem is that Chrome:

  1. Doesn’t expose any method to etch the data to a saved session
  2. Figuring out when history should be loaded, when saved to disk, and how to conect fast RAM with slow disk I/O is a true pain due to asynchronous nature Chrome is built on

And, any tab indication falls short because Chrome doesn’t have any API to reliably highlight tabs without selecting them.

Next steps?

Next thing I will most likely do is make the provisioning system that overrides Ctrl+Tab shortcut and installs the extension automatically.

The extension itself is memory safe and very useful as is. I don’t plan to update it anyhow besides changing the current branding.

0
4

Comments 0

No comments yet. Be the first!