Offex commited on
Commit
75302c8
·
verified ·
1 Parent(s): 61fc9c1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -3
app.py CHANGED
@@ -715,6 +715,8 @@ def ui():
715
  <a
716
  class="closed-popup-manual"
717
  href="https://audio.offexmail.online"
 
 
718
  >
719
  Continue to Website →
720
  </a>
@@ -743,9 +745,17 @@ def ui():
743
  setTimeout(() => {
744
  clearInterval(interval);
745
 
746
- window.location.replace(
747
- "https://audio.offexmail.online"
748
- );
 
 
 
 
 
 
 
 
749
  }, 2000);
750
 
751
  return [];
 
715
  <a
716
  class="closed-popup-manual"
717
  href="https://audio.offexmail.online"
718
+ target="_top"
719
+ rel="noopener noreferrer"
720
  >
721
  Continue to Website →
722
  </a>
 
745
  setTimeout(() => {
746
  clearInterval(interval);
747
 
748
+ const targetUrl = "https://audio.offexmail.online";
749
+
750
+ try {
751
+ // Gradio/Hugging Face can run custom JS inside
752
+ // an embedded context. Navigate the top-level page,
753
+ // not the HF app frame.
754
+ window.top.location.replace(targetUrl);
755
+ } catch (e) {
756
+ // Fallback for browsers that block top navigation.
757
+ window.open(targetUrl, "_top");
758
+ }
759
  }, 2000);
760
 
761
  return [];