Skip to content

Commit 8ad2d97

Browse files
authored
CF worker: remove readthedocs-doc-embed.js proxied (#201)
Remove `/_/static/.../readthedocs-doc-embed.js`.
1 parent acb2388 commit 8ad2d97

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

dockerfiles/force-readthedocs-addons.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,13 @@ const docEmbedJsAssets =
3232
'script[src="https://assets.readthedocs.org/static/javascript/readthedocs-doc-embed.js"]';
3333
const docEmbedJsAssetsCore =
3434
'script[src="https://assets.readthedocs.org/static/core/js/readthedocs-doc-embed.js"]';
35+
const docEmbedJsAssetsProxied =
36+
'script[src="/_/static/core/js/readthedocs-doc-embed.js"]';
3537
const badgeOnlyCssAssets =
3638
'link[href="https://assets.readthedocs.org/static/css/badge_only.css"]';
3739
const badgeOnlyCssAssetsProxied = 'link[href="/_/static/css/badge_only.css"]';
38-
const readthedocsExternalVersionWarning = "[role=main] > div:first-child > div:first-child.admonition.warning";
40+
const readthedocsExternalVersionWarning =
41+
"[role=main] > div:first-child > div:first-child.admonition.warning";
3942
const readthedocsFlyout = "div.rst-versions";
4043

4144
// "readthedocsDataParse" is the "<script>" that calls:
@@ -93,6 +96,7 @@ async function handleRequest(request) {
9396
.on(docEmbedCssAssets, new removeElement())
9497
.on(docEmbedJsAssets, new removeElement())
9598
.on(docEmbedJsAssetsCore, new removeElement())
99+
.on(docEmbedJsAssetsProxied, new removeElement())
96100
.on(badgeOnlyCssAssets, new removeElement())
97101
.on(badgeOnlyCssAssetsProxied, new removeElement())
98102
.on(readthedocsExternalVersionWarning, new removeElement())

0 commit comments

Comments
 (0)