Conversaciones » Peticiones de scripts
I want to create a small script for changing a small part of a url
A little bit later
// ==UserScript==
// @name deviantart.com: redirect to gallery
// @description Performs redirect from any user page to the user "gallery/all"
// @author Konf
// @namespace https://greasyfork.org/users/424058
// @icon https://www.google.com/s2/favicons?domain=deviantart.com&sz=32
// @version 1.0.0
// @include /^https?:\/\/www\.deviantart\.com\/[a-zA-Z0-9\-\_]+(?:\/gallery)?$/
// @run-at document-start
// @grant none
// @noframes
// ==/UserScript==
(function() {
const userName = location.pathname.split('/')[1];
window.location.href = location.origin + '/' + userName + '/gallery/all';
})();
@Konf, thank you very much! 🙏
Hi,
I want to create a script in which when I get into an artist profile in deviantart.com, the url changes -
from "deviantart.com/user" or "deviantart.com/user/gallery"
to "deviantart.com/user/gallery/all
It should probably be just a few lines of code, and should be easy enough with regex like
^https?:\/\/www\.deviantart\.com\/[a-zA-Z0-9\-\_]+(?:\/gallery)?
, but I'm not sure how to implement that into a script.Can anybody please help me with it?