From 07559930b31c4e9052bc09670196108471e106f9 Mon Sep 17 00:00:00 2001 From: yixiaojiu Date: Wed, 17 Apr 2024 20:43:22 +0800 Subject: [PATCH] fix: image cors --- docs/extra/image.js | 5 +++++ mkdocs.yml | 3 +++ 2 files changed, 8 insertions(+) create mode 100644 docs/extra/image.js diff --git a/docs/extra/image.js b/docs/extra/image.js new file mode 100644 index 0000000..d64ffc2 --- /dev/null +++ b/docs/extra/image.js @@ -0,0 +1,5 @@ +const images = document.querySelectorAll('img'); + +for (const image of images) { + image.setAttribute('referrerpolicy', 'no-referrer'); +} diff --git a/mkdocs.yml b/mkdocs.yml index 4098503..9842fc6 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -132,3 +132,6 @@ nav: - 28-Node.js底层原理(架构篇): chapter28-Node.js底层原理(架构篇).md - 29-Node.js底层原理(实现篇): chapter29-Node.js底层原理(实现篇).md +extra_javascript: + - path: extra/image.js + defer: true \ No newline at end of file