Wikipedia:Reference desk/Archives/Computing/2024 November 12#HTTP 451 and GDPR

Computing desk
< November 11 << Oct | November | Dec >> November 13 >
Welcome to the Wikipedia Computing Reference Desk Archives
The page you are currently viewing is a transcluded archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


November 12

[edit]

UserScript

[edit]

Why does this script works only from console but not from a userscript on wikipedia websites?

// ==UserScript==
// @name         x
// @match        *://*/*
// @run-at       document-start

// ==/UserScript==
window.setTimeout ( ()=>{
if (window.location.href.includes('wikipedia.org')) {
    window.open("https://example.com/", "_self");
    // window.location.replace("https://example.com");
    // window.location.href("https://example.com");
}
}, 100);

Thank you in advance. 223.24.184.76 (talk) 04:57, 12 November 2024 (UTC)[reply]

More information needed for an answer: How do you run the UserScript? Are you using a method that Wikipedia supports or a browser addin? If you are using a browser addin, which addin?
Do other scripts that use setTimeout or access window work fine?
Also, if we run into issues reproducing the problem you have after you've answered the above, we would also need to know what browsers (and version) you have tried this in. You've also not given any information about error messages in the console, so I'm assuming there are no error messages when you check the browser console. Komonzia (talk) 20:36, 17 November 2024 (UTC)[reply]

HTTP 451 and GDPR

[edit]

HTTP 451 mentions that many non-EU websites use this code when refusing traffic from EU countries, since they don't want to comply with the EU's General Data Protection Regulation. I'm confused: if you're not in an EU country, why do you have to comply with EU regulations of any sort? What can the EU do to you if you're not in the EU? Nyttend (talk) 22:06, 12 November 2024 (UTC)[reply]

Impose fines and if they're not paid, impound property you happen to have in the EU. Or, if you're traveling via the EU, holding you hostage until you've paid the fines.  --Lambiam 23:48, 12 November 2024 (UTC)[reply]
Not that most of that is likely for 'legit' websites, but these organisations don't want the extra overhead of even having to think about any of that, so this is the cheap way out for them. —TheDJ (talkcontribs) 12:35, 13 November 2024 (UTC)[reply]