From bfa9e0469e6e9cba2d03031a7fa602c7dbf44a7c Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sat, 25 Nov 2023 15:02:45 +0100 Subject: swextreload.reloadTab: Rename `letarget` variable 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. --- internal/swextreload.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/internal/swextreload.go b/internal/swextreload.go index 5ed8765..93ab7fd 100644 --- a/internal/swextreload.go +++ b/internal/swextreload.go @@ -147,13 +147,13 @@ func reloadExtension( func reloadTab( ctx context.Context, extensionID string, - letarget *target.Info, + reloadTarget *target.Info, ) error { // Don't cancel the context. Otherwise, the background page DevTools // window closes. ctx, cancel := chromedp.NewContext(ctx) - isMV2 := isExtensionManifestV2(letarget) + isMV2 := isExtensionManifestV2(reloadTarget) logDebugf("Reload tab (Manifest V2: %t)", isMV2) // If the extension is Manifest V3, its `targetId` reset after we reloaded @@ -190,11 +190,14 @@ func reloadTab( ctx, cancel = chromedp.NewContext(ctx, chromedp.WithTargetID(targetID)) defer cancel() } else { - logDebugf("Connecting to target %s", letarget.TargetID) + logDebugf("Connecting to target %s", reloadTarget.TargetID) // Don't cancel the context. Otherwise, the background page DevTools // window closes. - ctx, _ = chromedp.NewContext(ctx, chromedp.WithTargetID(letarget.TargetID)) + ctx, _ = chromedp.NewContext( + ctx, + chromedp.WithTargetID(reloadTarget.TargetID), + ) } var tabsResp []byte -- cgit v1.2.3