Are you sure you want to go to an external site to donate a monetary value?
WARNING: Some countries laws may supersede the payment processors policy such as the GDPR and PayPal. While it is highly appreciated to donate, please check with your countries privacy and identity laws regarding privacy of information first. Use at your utmost discretion.
I'm attempting to forge
content-type
header.I've attempted the followings:
XHR
request = new XMLHttpRequest(); request.open('GET', document.documentURI, false); request.overrideMimeType('text/plain'); request.setRequestHeader('content-type', 'text/plain'); request.send(); //console.info(`all headers: ${request.getAllResponseHeaders()}`); console.info(`content-type header: ${request.getResponseHeader('content-type')}`); console.info(`content-type document: ${document.contentType}`);
Fetch
fetch( document.documentURI, { method: 'GET', headers: { "content-type" : "text/plain", }, } ) .then((response) => { console.info(response.headers.get('content-type')) });
Both didn't work.
GM.xmlHttpRequest (incorporated into Promise)
gmXmlhttpRequest({ method: 'GET', url: document.documentURI, headers: { "Content-Type": "text/plain", "Accept": "text/plain" }, onprogress: function(request) { request.responseType = 'text'; }, onload: function(request) { request.overrideMimeType = 'text/plain'; if (document.URL.startsWith('file:') || request.status == 200) { myResolve(request); } else { myReject("File not Found"); } }, onerror: function(request) { console.log('Error Error Error') } })
Failed.
This is currently not possible due to restrictions of web browser engine; however, an extension can overcome this issue.