diff options
| author | Teddy Wing | 2023-11-25 14:56:15 +0100 | 
|---|---|---|
| committer | Teddy Wing | 2023-11-25 14:56:15 +0100 | 
| commit | 6d5c4ff7710f37ff75ffaf6465d529a2fce64d38 (patch) | |
| tree | b91cbcc0a5f649f38d89889476feb6f1d6011a54 /internal | |
| parent | b02dd4f742ec79a9e885a01579c15a151f5f9ebc (diff) | |
| download | swextreload-6d5c4ff7710f37ff75ffaf6465d529a2fce64d38.tar.bz2 | |
swextreload: Explain why we don't cancel certain contexts
Diffstat (limited to 'internal')
| -rw-r--r-- | internal/swextreload.go | 8 | 
1 files changed, 5 insertions, 3 deletions
| diff --git a/internal/swextreload.go b/internal/swextreload.go index ffa083d..92dd1b8 100644 --- a/internal/swextreload.go +++ b/internal/swextreload.go @@ -153,8 +153,9 @@ func reloadTab(  	letarget *target.Info,  	isExtensionManifestV2 bool,  ) error { +	// Don't cancel the context. Otherwise, the background page DevTools +	// window closes.  	ctx, cancel := chromedp.NewContext(ctx) -	// defer cancel()  	logDebugf("Reload tab (Manifest V2: %t)", isExtensionManifestV2) @@ -194,8 +195,9 @@ func reloadTab(  	} else {  		logDebugf("Connecting to target %s", letarget.TargetID) -		ctx, cancel = chromedp.NewContext(ctx, chromedp.WithTargetID(letarget.TargetID)) -		// defer cancel() +		// Don't cancel the context. Otherwise, the background page DevTools +		// window closes. +		ctx, _ = chromedp.NewContext(ctx, chromedp.WithTargetID(letarget.TargetID))  	}  	var tabsResp []byte | 
