Greasy Fork is available in English.

Remove file name from Apkadmin URLs

Removes unnecessary file name from Apkadmin URLs. This should be applicable to other websites too.

  1. // ==UserScript==
  2. // @name Remove file name from Apkadmin URLs
  3. // @namespace https://github.com/AbdurazaaqMohammed
  4. // @author Abdurazaaq Mohammed
  5. // @version 1.0
  6. // @description Removes unnecessary file name from Apkadmin URLs. This should be applicable to other websites too.
  7. // @match https://apkadmin.com/*
  8. // @grant none
  9. // @run-at document-start
  10. // @homepage https://github.com/AbdurazaaqMohammed/userscripts
  11. // @supportURL https://github.com/AbdurazaaqMohammed/userscripts/issues
  12. // @license The Unlicense
  13. // ==/UserScript==
  14.  
  15. (function() {
  16. 'use strict';
  17.  
  18. const url = window.location.href;
  19. const lastSlashIndex = url.lastIndexOf('/');
  20. if (lastSlashIndex > url.indexOf('//') + 1 && url.split('/').length > 4) {
  21. window.location.href = url.substring(0, lastSlashIndex);
  22. }
  23.  
  24. })();