Also posted at: Falkon, Greasemonkey, Tampermonkey and Violentmonkey.

I think it would be useful to add @nocors metadata block (similarly to @noframes) which would be productive in the sense of coding and consequently make userscript managers to behave in a uniform fashion.

no-www is using GM.xmlHttpRequest which doesn't seem to be supported with all userscript managers.

Example userscript

if (!location.host.startsWith('www.')) return; // exit (else, continue)

var newURL = location.href.replace('://www.','://');

GM.xmlHttpRequest({
  method: 'GET',
  url: newURL,
  synchronous: true,
  onprogress: console.log('Checking for no-www...'),
  onload: function(response) {
    if (response.finalUrl == newURL) {
      location.href = newURL;
    } else {
      console.log('Please contact webmaster to remove www. https://no-www.org/');
    }
  },
  onerror: function(response) {
    console.log('Error requesting for no-www')
  }
})

If @nocors was introduced, this script could have been shorter.

fetch(newURL)
  .then((response) => {
     if (request.reseponseURL == newURL) {
       window.open(newURL,'_self');
     }
  })