From 8d3024b2011e96e3a610f6b1cec0c009a9fbb5f3 Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Thu, 13 Nov 2025 02:05:51 +1300 Subject: [PATCH] error message if script blocked --- src/page-captcha.rkt | 2 +- src/page-wiki-jsonp.rkt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/page-captcha.rkt b/src/page-captcha.rkt index df4f5bb..dcbf818 100644 --- a/src/page-captcha.rkt +++ b/src/page-captcha.rkt @@ -151,7 +151,7 @@ (when (config-true? 'captcha::log) (printf "captcha pass - key ~a [~a]~n" x (get-ip req))) - (header #"Set-Cookie" (cookie->set-cookie-header (make-cookie "captcha" "key" #:path "/" #:max-age (* 60 60 24 365 10))))] + (header #"Set-Cookie" (cookie->set-cookie-header (make-cookie "captcha" "key" #:path "/" #:max-age (* 60 60 24 365 10) #:http-only? #t #:secure? #t)))] [(= y 0) (when (config-true? 'captcha::log) (printf "captcha fail - key ~a instead of ~a [~a]~n" x (get-key-solution req) (get-ip req)))] diff --git a/src/page-wiki-jsonp.rkt b/src/page-wiki-jsonp.rkt index ada846e..55c98f5 100644 --- a/src/page-wiki-jsonp.rkt +++ b/src/page-wiki-jsonp.rkt @@ -53,8 +53,8 @@ var jsonpData = {} var proxy = new Proxy(jsonpData, {get(obj, prop) { return value => obj[prop] = value }}) END ) - (script (@ (async) (src ,wiki-page-script-url))) - (script (@ (async) (src ,siteinfo-script-url))) + (script (@ (async) (src ,wiki-page-script-url) (onerror "proxy.wikipage({error: {code: 'script blocked', info: 'Fandom connection failed or was blocked by your browser. Check any browser extensions that may block third-party scripts, then reload the page.'}})"))) + (script (@ (async) (src ,siteinfo-script-url) (onerror "proxy.siteinfo({error: {code: 'script blocked', info: 'Fandom connection failed or was blocked by your browser. Check any browser extensions that may block third-party scripts, then reload the page.'}})"))) (script (@ (type "module") (src ,(get-static-url "jsonp.js"))))) #:req req #:source-url source-url