Dodano obsługę URL w celu odcięcia części z hash oraz dodano logowanie dla niepasujących wzorców URL.

This commit is contained in:
2025-07-14 00:45:46 +02:00
parent 958b792da3
commit 3943502bf7

View File

@@ -1,4 +1,4 @@
const currentUrl = window.location.href; const currentUrl = window.location.href.split('#')[0]; // odcinamy część z hash
const patterns = [ const patterns = [
/^https:\/\/projectpro\.apilo\.com\/order\/order\/news\/?$/, /^https:\/\/projectpro\.apilo\.com\/order\/order\/news\/?$/,
/^https:\/\/projectpro\.apilo\.com\/order\/order\/in-progress\/?$/, /^https:\/\/projectpro\.apilo\.com\/order\/order\/in-progress\/?$/,
@@ -6,9 +6,11 @@ const patterns = [
/^https:\/\/projectpro\.apilo\.com\/order\/order\/completed\/?$/, /^https:\/\/projectpro\.apilo\.com\/order\/order\/completed\/?$/,
/^https:\/\/projectpro\.apilo\.com\/order\/order\/all\/?$/ /^https:\/\/projectpro\.apilo\.com\/order\/order\/all\/?$/
]; ];
if (patterns.some(pattern => pattern.test(currentUrl))) { if (patterns.some(pattern => pattern.test(currentUrl))) { console.log('test');
waitForTableAndSetImage(); waitForTableAndSetImage();
attachTableReloadListener(); attachTableReloadListener();
} else {
console.log('Nie pasuje do żadnego wzorca URL');
} }
function waitForTableAndSetImage() { function waitForTableAndSetImage() {