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:
6
apilo.js
6
apilo.js
@@ -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() {
|
||||||
|
|||||||
Reference in New Issue
Block a user