Min vor 7 Jahren
Ursprung
Commit
aab57e4348
1 geänderte Dateien mit 23 neuen und 1 gelöschten Zeilen
  1. 23 1
      simplify.user.js

+ 23 - 1
simplify.user.js

@@ -1,6 +1,6 @@
 // ==UserScript==
 // @name         Simplify URLs
-// @version      0.1
+// @version      0.2
 // @description  Shortens URL for various websites
 // @author       min
 // @license      MIT; https://gogs.infcof.com/min/userscripts/src/master/LICENSE
@@ -9,6 +9,10 @@
 // @match        https://www.amazon.co.uk/*/dp/*
 // @match        https://www.amazon.co.uk/gp/product/*
 // @match        https://www.aliexpress.com/item/*
+// @match        https://autoplius.lt/skelbimai/*.html
+// @match        https://autogidas.lt/skelbimas/*.html
+// @match        https://skelbiu.lt/skelbimai/*.html
+// @match        https://www.fasttech.com/products/*
 // @grant        none
 // ==/UserScript==
 
@@ -31,6 +35,24 @@
     redir = '/item//' + s[s.length -1];
   }
 
+  else if(window.location.hostname.indexOf("fasttech") !== -1) {
+    let s = window.location.pathname.split('/');
+    let d = s[s.length -1].split('-');
+    redir = '/products/' + d[0];
+  }
+
+  else if(window.location.hostname.indexOf("autoplius.lt") !== -1 ||
+      window.location.hostname.indexOf("autogidas.lt") !== -1) {
+    let s = window.location.pathname.split('-');
+    let d = window.location.pathname.split('/');
+    redir = '/'+ d[1] + '/-' + s[s.length -1];
+  }
+
+  else if(window.location.hostname.indexOf("skelbiu.lt") !== -1) {
+    let s = window.location.pathname.split('-');
+    redir = '/skelbimai/' + s[s.length -1];
+  }
+
   if(window.location.pathname === redir) return;
   console.log("Shorting URL:", window.location.href, "->", redir);
   history.pushState(null, '', redir);