diff options
author | Teddy Wing | 2021-02-09 01:55:38 +0100 |
---|---|---|
committer | Teddy Wing | 2021-02-09 01:55:38 +0100 |
commit | a32473a3f82e926b6a6ad73c32d485fbe27aadda (patch) | |
tree | 6a3aba941d7f6524c6223332f27486826989b5c1 /l/src/main.lisp | |
parent | ed11bce205dfd257a1cdb2ff3c3f96790a16e88b (diff) | |
download | extreload-a32473a3f82e926b6a6ad73c32d485fbe27aadda.tar.bz2 |
Always reload current tab after reloading an extension
A bit crude, but it covers us when extensions are in multiple Chrome
profiles. This ensures the desired tab is reloaded because all current
tabs in all profiles that have requested extensions are reloaded.
Not very intelligent, but a simple approach.
Diffstat (limited to 'l/src/main.lisp')
-rw-r--r-- | l/src/main.lisp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/l/src/main.lisp b/l/src/main.lisp index c2177e5..22c1d07 100644 --- a/l/src/main.lisp +++ b/l/src/main.lisp @@ -75,17 +75,18 @@ ; Response: (OBJ (id . 2) ; (result OBJ (sessionId . C24A99CA53CBD76EB68BCBD0D172A4E7))) - (when reload-current-tab + (when (and reload-current-tab + (runtime-evaluate-msg-p response)) ; (when (and (= (or (json-obj-get response "id") -1) 1) - (when (and - (= *reloaded-count* - ;; TODO: Probably want to reload on all extension reload calls - *extension-targets-count*) - - (string= (json-obj-get - (json-obj-get response "result") - "sessionId") - *last-session-id*)) + ; (when (and + ; (= *reloaded-count* + ; ;; TODO: Probably want to reload on all extension reload calls + ; *extension-targets-count*) + ; + ; (string= (json-obj-get + ; (json-obj-get response "result") + ; "sessionId") + ; *last-session-id*)) ; (let ((current-call-id (json-obj-get response "id"))) ; (when (and current-call-id ; (= current-call-id @@ -94,7 +95,7 @@ ; (sleep 1) (reload-tab (json-obj-get (json-obj-get response "result") - "sessionId")))) + "sessionId"))) ;; Failed to reload tab. (when (jsown:keyp (json-obj-get response "result") "exceptionDetails") |