Skip to content

Commit

Permalink
CF worker: remove readthedocs-doc-embed.js proxied (#201)
Browse files Browse the repository at this point in the history
Remove `/_/static/.../readthedocs-doc-embed.js`.
  • Loading branch information
humitos committed Feb 14, 2024
1 parent acb2388 commit 8ad2d97
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion dockerfiles/force-readthedocs-addons.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,13 @@ const docEmbedJsAssets =
'script[src="https://assets.readthedocs.org/static/javascript/readthedocs-doc-embed.js"]';
const docEmbedJsAssetsCore =
'script[src="https://assets.readthedocs.org/static/core/js/readthedocs-doc-embed.js"]';
const docEmbedJsAssetsProxied =
'script[src="/_/static/core/js/readthedocs-doc-embed.js"]';
const badgeOnlyCssAssets =
'link[href="https://assets.readthedocs.org/static/css/badge_only.css"]';
const badgeOnlyCssAssetsProxied = 'link[href="/_/static/css/badge_only.css"]';
const readthedocsExternalVersionWarning = "[role=main] > div:first-child > div:first-child.admonition.warning";
const readthedocsExternalVersionWarning =
"[role=main] > div:first-child > div:first-child.admonition.warning";
const readthedocsFlyout = "div.rst-versions";

// "readthedocsDataParse" is the "<script>" that calls:
Expand Down Expand Up @@ -93,6 +96,7 @@ async function handleRequest(request) {
.on(docEmbedCssAssets, new removeElement())
.on(docEmbedJsAssets, new removeElement())
.on(docEmbedJsAssetsCore, new removeElement())
.on(docEmbedJsAssetsProxied, new removeElement())
.on(badgeOnlyCssAssets, new removeElement())
.on(badgeOnlyCssAssetsProxied, new removeElement())
.on(readthedocsExternalVersionWarning, new removeElement())
Expand Down

0 comments on commit 8ad2d97

Please sign in to comment.