diff options
| author | Teddy Wing | 2023-11-13 03:09:16 +0100 | 
|---|---|---|
| committer | Teddy Wing | 2023-11-13 03:09:16 +0100 | 
| commit | b226bb4feb23e0c1a073de455466f612e0c1f06c (patch) | |
| tree | 84f87e5e96d3622819bc1ca19da630d7b252f761 /src | |
| parent | 15f55656e63e0ef32954d27a5efa1fa05790358c (diff) | |
| download | extreload-b226bb4feb23e0c1a073de455466f612e0c1f06c.tar.bz2 | |
main: Try to force re-attach to service worker to reload the current tab
Doesn't appear to be working, unfortunately. The idea was to force the
execution of the re-attach instead of checking for a targetCrashed
message (which I would get only very rarely). In this way, we ensure
that we re-attach to the service worker before running the tab reload.
But that doesn't seem to be enough.
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.lisp | 14 | 
1 files changed, 10 insertions, 4 deletions
| diff --git a/src/main.lisp b/src/main.lisp index cf4facf..630a8b9 100644 --- a/src/main.lisp +++ b/src/main.lisp @@ -71,13 +71,14 @@          (attach-extensions targets extension-ids))) +    ;; TODO: Force to attach a second time      (when (target-attached-to-target-msg-p response)        (when (and (reload-current-tab config)                   (target-attached-to-target-msg-manifest-v3-extension-p response))          ;; response is an extension in *extensions*          (reload-tab (json-obj-get -                      (json-obj-get response "result") +                      (json-obj-get response "params")                        "sessionId"))          (return-from ws-on-message)) @@ -106,9 +107,14 @@      (when (and (reload-current-tab config)                 (runtime-evaluate-msg-p response)) -      (reload-tab (json-obj-get -                    (json-obj-get response "result") -                    "sessionId"))) +      (websocket-send +        (ws-client *config*) +        (target-get-targets-msg +          (next-call-id *devtools-root-call-id*))) +      ; (reload-tab (json-obj-get +      ;               (json-obj-get response "result") +      ;               "sessionId")) +      )      ;; Failed to reload tab.      (when (runtime-evaluate-exception-p response) | 
