Merge pull request #401 from kiwix/rgaudin/external-block-warn

Added comment marking dependency of a JS variable with warc2zim
This commit is contained in:
Kelson 2020-08-19 18:32:22 +02:00 committed by GitHub
commit c183f57670
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -1,3 +1,4 @@
// `block_path` variable used by openzim/warc2zim to detect whether URL blocking is enabled or not
var block_path = "/catch/external"; var block_path = "/catch/external";
// called only on external links // called only on external links
function capture_event(e, target) { target.setAttribute("href", encodeURI(block_path + "?source=" + target.href)); } function capture_event(e, target) { target.setAttribute("href", encodeURI(block_path + "?source=" + target.href)); }