aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2023-11-25README: Add note about Manifest V2 unreliabilityTeddy Wing
2023-11-25Add READMETeddy Wing
2023-11-25Add license (GNU GPLv3+)Teddy Wing
2023-11-25swextreload: Choose the first non-nil target to reload the current tabTeddy Wing
It's possible for the first extension target to be nil. If that happens, keep going through the list of input extensions until we find a target that isn't nil.
2023-11-25swextreload: Go fmtTeddy Wing
2023-11-25swextreload.reloadTab: Add function documentationTeddy Wing
2023-11-25swextreload.isExtensionManifestV2: Add function documentationTeddy Wing
2023-11-25swextreload.reloadTab: Rename `letarget` variableTeddy Wing
That was just a temporary name as I wasn't sure if I was going to keep the argument. Now that this seems to work, rename the variable to something more understandable.
2023-11-25swextreload.reloadTab: Remove `isExtensionManifestV2` argumentTeddy Wing
It was a bit confusing to have a variable and a function with the same name.
2023-11-25swextreload: Explain why we don't cancel certain contextsTeddy Wing
2023-11-25swextreload: Explain MV2 vs. MV3 tab reload handlingTeddy Wing
2023-11-25swextreload: Explain 200 millisecond sleep before reloading tabTeddy Wing
2023-11-25swextreload: Remove finished TODOsTeddy Wing
2023-11-20swextreload: Ideas for problems sending messagesTeddy Wing
I'm sometimes having trouble sending messages to the extension pages. Trying out different things here but nothing appears to be cutting it just yet. It seems like there are times when we just don't get a response back or can't connect to a target for whatever reason, either in the initial extension reload step or in the tab reload. Also, since the delay for tab reloading appears to only be relevant for Manifest V3 extensions, I added a condition before sleeping.
2023-11-19swextreload: Timeout after five secondsTeddy Wing
If there's a hangup in the DevTools Protocol communication, just exit like we did in Extreload.
2023-11-18swextreload: Debugging service worker inactiveTeddy Wing
I was getting an error sending to a null `target`. At first I thought I should send the tab reload message to the last extension instead of the first extension. But I later discovered that the inactive service worker isn't even in the list of targets from `Target.getTargets`. Not sure what to about this one. Is it possible to wake up the service worker since we know its ID/URL?
2023-11-18swextreload: Extract debug logging to functionTeddy Wing
Move the `isDebug` check to a function so we don't have to put conditions everywhere.
2023-11-17swextreload: Make tab reload work on both MV2 and MV3 contextsTeddy Wing
2023-11-17swextreload: Fix MV2 extension reloadTeddy Wing
There was a problem reloading the tab from an MV2 extension, and reloading the extension after the first time. Looks like I needed to cancel the context in order to be able to evaluate other statements in the background page.
2023-11-17swextreload: Reload all targets matching a given extension IDTeddy Wing
There may be multiple instances of the same extension ID. Ensure all of them are reloaded.
2023-11-17swextreload: Test Runtime.evaluateTeddy Wing
No change.
2023-11-17swextreload: Try lifting getTargets outside of `reloadExtension`Teddy Wing
Call getTargets only once, not each time we want to reload an extension. This hasn't resolved the wonkiness I'm seeing with reloading multiple extensions, unfortunately.
2023-11-16swextreload: Note about getting targets onceTeddy Wing
2023-11-16Try not cancelling contextTeddy Wing
Turns out this is what was closing the extension background page DevTools window. We shouldn't run the context cancel function.
2023-11-16swextreload: Experiment with MV2 tab reloadingTeddy Wing
Trying to set things up to not get targets again when reloading the current tab.
2023-11-14swextreload: Try to split out tab reloading into a separate functionTeddy Wing
Trying to make it so you can reload the tab only once after reloading all extensions. This still works for a single Manifest V3 extension, but I'm having trouble getting a Manifest V2 extension to reload properly.
2023-11-14swextreload: Add note for multiple extension handlingTeddy Wing
2023-11-14swextreload.Reload: Handle multiple extensionsTeddy Wing
Get rid of the `return` so we reload more than the first extension.
2023-11-14Add man pageTeddy Wing
Copy the man page from Extreload and just change the name of the executable.
2023-11-14swextreload: Add package documentationTeddy Wing
2023-11-14swextreload: Add documentation commentsTeddy Wing
2023-11-14swextreload.reloadExtension: Remove old commented codeTeddy Wing
2023-11-14Make `--reload-current-tab` flag workTeddy Wing
Make the tab reload work based on the flag instead of always reloading.
2023-11-14main: Add better error printingTeddy Wing
Print errors in a consistent way instead of using `log`, which was just for rapid development. Also exit using codes that make sense.
2023-11-14Add `--debug` flagTeddy Wing
Condition printing debug output on the presence of this flag.
2023-11-14main: Print errors to standard errorTeddy Wing
2023-11-14swextreload.reloadExtension: Return errorsTeddy Wing
Add our own errors and return these instead of logging them.
2023-11-14swextreload.Reload: Accept a list of extension IDsTeddy Wing
Run the reload on multiple extensions.
2023-11-14main: Change hard-coded exit codes to sysexits namesTeddy Wing
2023-11-14main: Print errors on `--socket-url` and extension IDs missingTeddy Wing
In order to print a custom error message for missing extension IDs, I needed to set a default value for it. Looks like the type assertions are necessary. Not the cleanest, but no matter.
2023-11-14main: Add basic command line argument parsingTeddy Wing
Found Claw from a search for "argument parser" on https://godocs.io. I did a quick comparison with a few other argument parsing libraries I found in a GitHub search: * https://github.com/alexflint/go-arg * https://github.com/docopt/docopt.go * https://github.com/fred1268/go-clap Claw ended up being the most straightforward to me.
2023-11-14swextreload.Reload: Extract argumentsTeddy Wing
2023-11-14Move `main.go` to `cmd/swextreload/main.go`Teddy Wing
Put the executable in a cmd/ directory.
2023-11-14Move code from `main()` to `swextreload.Reload()`Teddy Wing
Move everything to our library.
2023-11-14internal/swextreload: Get rid of option interface, use plain argumentsTeddy Wing
2023-11-14Move swextreload.go to internal/Teddy Wing
Don't make this a public API. I'd rather do something simple and bad to get this finished quickly.
2023-11-14swextreload: Idea for a library APITeddy Wing
An idea for a library function to reload an extension.
2023-11-13Ideas for Extreload tab reloading for Manifest V3Teddy Wing
I was having a hard time jiggering the Extreload code to get tab reloading working with Manifest V3 extensions. This is an experiment using a better API to interact with the Chrome DevTools Protocol. It does correctly reload a Manifest V3 extension's current tab, by sleeping briefly to wait for the service worker to reinstall, then executing the tab reload call.