diff --git a/images/ui-base/purge-google-fonts.sh b/images/ui-base/purge-google-fonts.sh index 2e759f1..4ceb65f 100644 --- a/images/ui-base/purge-google-fonts.sh +++ b/images/ui-base/purge-google-fonts.sh @@ -4,9 +4,13 @@ SOURCE_CODE_PATH=/usr/local/lib/python3.11/site-packages/gradio/ # Strip out preconnect directives from HTML tags find $SOURCE_CODE_PATH -name "*.html" -type f -exec sed -i s!'rel="preconnect"'!!g {} \; -# Replace links with something harmless but identifiable -declare -a LINKS=("https://fonts.gstatic.com" "https://fonts.googleapis.com") -REPLACEMENT="no-google-fonts-here" +# Replace hard-coded links in HTML templates with something harmless but identifiable +declare -a LINKS=( + "https://fonts.gstatic.com" + "https://fonts.googleapis.com" + "https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/.*/iframeResizer.contentWindow.min.js" +) +REPLACEMENT="no-GDPR-violations-here" for item in "${LINKS[@]}"; do find $SOURCE_CODE_PATH -name "*.html" -type f -exec sed -i s!$item!$REPLACEMENT!g {} \; done