Skip to content

Commit

Permalink
Pure additional CDN links
Browse files Browse the repository at this point in the history
  • Loading branch information
sd109 committed May 1, 2024
1 parent 7d0548f commit 41d934f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions images/ui-base/purge-google-fonts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ SOURCE_CODE_PATH=/usr/local/lib/python3.11/site-packages/gradio/
# Strip out preconnect directives from HTML <link> 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

0 comments on commit 41d934f

Please sign in to comment.