Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions android/app/src/main/assets/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
<script>(function(){try{var p=localStorage.getItem("animetv-resume-positions");if(p&&p.length>2)document.documentElement.setAttribute("data-has-history","");}catch(e){}})()</script>
<!-- Defer all JS - browser discovers them early but executes after DOM parse -->
<link rel="preconnect" href="https://cdn.jsdelivr.net" crossorigin>
<script defer src="js/speed-insights.js?v=645"></script>
<script defer src="js/constants.js?v=645"></script>
<script defer src="js/translations.js?v=645"></script>
<script defer src="js/utils.js?v=645"></script>
Expand Down
48 changes: 48 additions & 0 deletions android/app/src/main/assets/js/speed-insights.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// Vercel Speed Insights initialization
// This script loads and initializes Vercel Speed Insights for performance monitoring

(function() {
'use strict';

// Initialize the Speed Insights queue
window.si = window.si || function() {
(window.siq = window.siq || []).push(arguments);
};

// Load the Speed Insights script
function loadSpeedInsights() {
// Check if we're in a browser environment
if (typeof window === 'undefined') return;

// Check if script is already loaded
const scriptSrc = '/_vercel/speed-insights/script.js';
if (document.head.querySelector(`script[src*="${scriptSrc}"]`)) {
return;
}

// Create and inject the script
const script = document.createElement('script');
script.src = scriptSrc;
script.defer = true;

// Add SDK metadata
script.dataset.sdkn = '@vercel/speed-insights';
script.dataset.sdkv = '2.0.0';

script.onerror = function() {
console.log(
'[Vercel Speed Insights] Failed to load script from ' + scriptSrc + '. ' +
'Please check if any content blockers are enabled and try again.'
);
};

document.head.appendChild(script);
}

// Load on DOM ready
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', loadSpeedInsights);
} else {
loadSpeedInsights();
}
})();
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
<script>(function(){try{var p=localStorage.getItem("animetv-resume-positions");if(p&&p.length>2)document.documentElement.setAttribute("data-has-history","");}catch(e){}})()</script>
<!-- Defer all JS - browser discovers them early but executes after DOM parse -->
<link rel="preconnect" href="https://cdn.jsdelivr.net" crossorigin>
<script defer src="js/speed-insights.js?v=645"></script>
<script defer src="js/constants.js?v=645"></script>
<script defer src="js/translations.js?v=645"></script>
<script defer src="js/utils.js?v=645"></script>
Expand Down
48 changes: 48 additions & 0 deletions js/speed-insights.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// Vercel Speed Insights initialization
// This script loads and initializes Vercel Speed Insights for performance monitoring

(function() {
'use strict';

// Initialize the Speed Insights queue
window.si = window.si || function() {
(window.siq = window.siq || []).push(arguments);
};

// Load the Speed Insights script
function loadSpeedInsights() {
// Check if we're in a browser environment
if (typeof window === 'undefined') return;

// Check if script is already loaded
const scriptSrc = '/_vercel/speed-insights/script.js';
if (document.head.querySelector(`script[src*="${scriptSrc}"]`)) {
return;
}

// Create and inject the script
const script = document.createElement('script');
script.src = scriptSrc;
script.defer = true;

// Add SDK metadata
script.dataset.sdkn = '@vercel/speed-insights';
script.dataset.sdkv = '2.0.0';

script.onerror = function() {
console.log(
'[Vercel Speed Insights] Failed to load script from ' + scriptSrc + '. ' +
'Please check if any content blockers are enabled and try again.'
);
};

document.head.appendChild(script);
}

// Load on DOM ready
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', loadSpeedInsights);
} else {
loadSpeedInsights();
}
})();
87 changes: 39 additions & 48 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"dependencies": {
"@supabase/ssr": "^0.12.0",
"@supabase/supabase-js": "^2.108.1",
"@vercel/speed-insights": "^2.0.0",
"hls.js": "^1.6.16",
"sharp": "0.35.2"
},
Expand Down
Loading