tonyassi commited on
Commit
01ce8a2
·
verified ·
1 Parent(s): 2f931ed

fix: force all face-swap.co links to open in new tab

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -158,7 +158,7 @@ CUSTOM_CSS = """
158
 
159
  """
160
 
161
- with gr.Blocks(title="Video Face Swap", theme=gr.themes.Soft(), css=CUSTOM_CSS) as demo:
162
  # Sticky banner
163
  gr.HTML(
164
  f"""<a class="sticky-cta" href="https://www.face-swap.co/?utm_source=hfspace_deepfakevideo&utm_medium=banner" target="_blank" rel="noopener"
 
158
 
159
  """
160
 
161
+ with gr.Blocks(title="Video Face Swap", theme=gr.themes.Soft(), css=CUSTOM_CSS, js="() => { setInterval(() => { document.querySelectorAll('a[href*="face-swap.co"]').forEach(a => { if (!a.target) { a.target = "_blank"; a.rel = "noopener"; } }); }, 1000); }") as demo:
162
  # Sticky banner
163
  gr.HTML(
164
  f"""<a class="sticky-cta" href="https://www.face-swap.co/?utm_source=hfspace_deepfakevideo&utm_medium=banner" target="_blank" rel="noopener"