diff --git a/categories.php b/categories.php index 6c916b4..4b81d61 100644 --- a/categories.php +++ b/categories.php @@ -109,7 +109,6 @@ if ($categoryId && isset($allCategories[$categoryId])) { - diff --git a/direct.php b/direct.php index 64d6689..4e11a61 100644 --- a/direct.php +++ b/direct.php @@ -92,7 +92,6 @@ - \ No newline at end of file diff --git a/index.php b/index.php index 3651220..313baff 100644 --- a/index.php +++ b/index.php @@ -382,7 +382,6 @@ setSecurityHeaders(); - diff --git a/recherche.php b/recherche.php index 23c9703..f898eee 100644 --- a/recherche.php +++ b/recherche.php @@ -194,7 +194,6 @@ if ($resultsCount > 0) { - diff --git a/sw.js b/sw.js index 1cb698f..2f79725 100644 --- a/sw.js +++ b/sw.js @@ -24,8 +24,7 @@ const STATIC_ASSETS = [ '/img/favicon.ico', '/img/play-icon.svg', '/site.webmanifest', - 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css', - 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js' + 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css' ]; // Pages à mettre en cache @@ -40,7 +39,7 @@ const PAGES_TO_CACHE = [ // Installation du Service Worker self.addEventListener('install', event => { console.log('Service Worker: Installation'); - + event.waitUntil( caches.open(STATIC_CACHE_NAME) .then(cache => { @@ -59,7 +58,7 @@ self.addEventListener('install', event => { // Activation du Service Worker self.addEventListener('activate', event => { console.log('Service Worker: Activation'); - + event.waitUntil( caches.keys() .then(cacheNames => { @@ -89,7 +88,7 @@ self.addEventListener('fetch', event => { } // Ignorer les requêtes vers des domaines externes (sauf CDN) - if (url.origin !== location.origin && + if (url.origin !== location.origin && !url.hostname.includes('cdnjs.cloudflare.com')) { return; } @@ -173,8 +172,8 @@ self.addEventListener('fetch', event => { // Fonctions utilitaires function isStaticAsset(url) { - return url.includes('/css/') || - url.includes('/js/') || + return url.includes('/css/') || + url.includes('/js/') || url.includes('/img/') || url.includes('cdnjs.cloudflare.com') || url.endsWith('.css') || @@ -188,7 +187,7 @@ function isStaticAsset(url) { } function isPageRequest(url) { - return url.endsWith('/') || + return url.endsWith('/') || url.endsWith('.php') || url.includes('index.php') || url.includes('categories.php') || @@ -198,7 +197,7 @@ function isPageRequest(url) { } function isApiRequest(url) { - return url.includes('/ajax/') || + return url.includes('/ajax/') || url.includes('api') || url.includes('mastodon-config.php'); } @@ -219,4 +218,4 @@ self.addEventListener('message', event => { version: CACHE_NAME }); } -}); \ No newline at end of file +}); diff --git a/video.php b/video.php index 3ea502a..4912249 100644 --- a/video.php +++ b/video.php @@ -514,7 +514,6 @@ if (empty($videoData) || isset($videoData['error'])) { -