From a32473a3f82e926b6a6ad73c32d485fbe27aadda Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Tue, 9 Feb 2021 01:55:38 +0100 Subject: 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. --- l/src/main.lisp | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'l/src/main.lisp') 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") -- cgit v1.2.3