Skip to content

Instantly share code, notes, and snippets.

@Vanawy
Last active November 16, 2023 12:22
Show Gist options
  • Save Vanawy/cdf5edcdd574b3ed59206b4bc1c3e31c to your computer and use it in GitHub Desktop.
Save Vanawy/cdf5edcdd574b3ed59206b4bc1c3e31c to your computer and use it in GitHub Desktop.
Wildberries.by 404 fix
// ==UserScript==
// @name Wildberries 404 Fix
// @namespace http://tampermonkey.net/
// @version 0.2.1
// @description try to take over the world!
// @author You
// @match https://www.wildberries.by/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=wildberries.by
// @grant none
// @homepage https://gist.github.com/Vanawy/
// @updateURL https://gist.githubusercontent.com/Vanawy/cdf5edcdd574b3ed59206b4bc1c3e31c/raw/wb.js
// @downloadURL https://gist.githubusercontent.com/Vanawy/cdf5edcdd574b3ed59206b4bc1c3e31c/raw/wb.js
// ==/UserScript==
(function() {
'use strict';
let location = new URL(window.location.href);
let m = location.pathname.match(/\/catalog\/(\d+)\/detail.aspx/i)
if (m) {
let url = new URL('/product', location);
url.searchParams.append('card', m[1]);
let option = location.searchParams.get('size');
if (option) {
url.searchParams.append('option', option);
}
window.location = url.href;
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment