Guest User

Untitled

a guest
Apr 13th, 2025
15
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Warframe Wiki Redirect
  3. // @description Redirects Warframe Fandom wiki URLs to the new official wiki
  4. // @match https://warframe.fandom.com/wiki/*
  5. // @icon https://www.google.com/s2/favicons?sz=64&domain=warframe.com
  6. // @grant none
  7. // @run-at document-start
  8. // ==/UserScript==
  9.  
  10. (function() {
  11. 'use strict';
  12.  
  13. // Get current path and parameters
  14. const currentPath = window.location.pathname;
  15. const params = window.location.search;
  16. const hash = window.location.hash;
  17.  
  18. // Only process paths that start with /wiki/
  19. if (currentPath.startsWith('/wiki/')) {
  20. // Extract the article path (remove '/wiki/' prefix)
  21. const articlePath = currentPath.slice(6);
  22.  
  23. // Build new URL
  24. const newUrl = `https://wiki.warframe.com/w/${articlePath}${params}${hash}`;
  25.  
  26. // Perform redirect
  27. window.location.replace(newUrl);
  28. }
  29. })();
Add Comment
Please, Sign In to add comment