New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gmxhr-fetch

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gmxhr-fetch - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

19

gmxhr-fetch.js

@@ -72,10 +72,13 @@ ;((global, fn) => {

new Promise(res => {
// defaults
Object.assign(init, {
method: 'GET',
headers: {}
})
// overrides
init.url = input
init.responseType = 'arrayBuffer'
init = Object.assign(
{
method: 'GET',
headers: {}
},
init,
{
url: input,
responseType: 'arrayBuffer'
}
)
GM.xmlHttpRequest(

@@ -82,0 +85,0 @@ Object.assign({}, init, {

@@ -1,1 +0,1 @@

((a,b)=>{a.gmfetch=b("undefined"==typeof GM?{}:GM)})(this,a=>{if("undefined"==typeof GM_xmlhttpRequest&&"undefined"==typeof a.xmlHttpRequest)throw new Error("Either GM_xmlhttpRequest or GM.xmlHttpRequest must exists!");"function"!=typeof GM_xmlhttpRequest||a.xmlHttpRequest||(a.xmlHttpRequest=GM_xmlhttpRequest);class b{constructor(a,b){this.xhr=a,this.init=b}async arrayBuffer(){return this.xhr.response}async blob(){return new Blob([this.xhr.response])}async formData(){throw new Error("No implemented!")}async json(){return JSON.parse((await this.text()))}async text(){const a=new TextDecoder;return a.decode(this.xhr.response)}clone(){return Object.assign({},this)}redirect(){return this.clone()}get ok(){return 200<=this.xhr.status&&300>this.xhr.status}get headers(){return new Headers(this.xhr.headers)}get status(){return this.xhr.status}get statusText(){return this.xhr.statusText}get type(){return"cors"}get url(){return this.init.url}get bodyUsed(){return"GET"!==this.xhr.method.toUpperCase()}get redirected(){return!0}get useFinalURL(){return!0}}return(c,d={})=>new Promise(e=>{Object.assign(d,{method:"GET",headers:{}}),d.url=c,d.responseType="arrayBuffer",a.xmlHttpRequest(Object.assign({},d,{onload:a=>e(new b(a,d)),onerror:a=>e(new b(a,d))}))})});
((a,b)=>{a.gmfetch=b("undefined"==typeof GM?{}:GM)})(this,a=>{if("undefined"==typeof GM_xmlhttpRequest&&"undefined"==typeof a.xmlHttpRequest)throw new Error("Either GM_xmlhttpRequest or GM.xmlHttpRequest must exists!");"function"!=typeof GM_xmlhttpRequest||a.xmlHttpRequest||(a.xmlHttpRequest=GM_xmlhttpRequest);class b{constructor(a,b){this.xhr=a,this.init=b}async arrayBuffer(){return this.xhr.response}async blob(){return new Blob([this.xhr.response])}async formData(){throw new Error("No implemented!")}async json(){return JSON.parse((await this.text()))}async text(){const a=new TextDecoder;return a.decode(this.xhr.response)}clone(){return Object.assign({},this)}redirect(){return this.clone()}get ok(){return 200<=this.xhr.status&&300>this.xhr.status}get headers(){return new Headers(this.xhr.headers)}get status(){return this.xhr.status}get statusText(){return this.xhr.statusText}get type(){return"cors"}get url(){return this.init.url}get bodyUsed(){return"GET"!==this.xhr.method.toUpperCase()}get redirected(){return!0}get useFinalURL(){return!0}}return(c,d={})=>new Promise(e=>{d=Object.assign({method:"GET",headers:{}},d,{url:c,responseType:"arrayBuffer"}),a.xmlHttpRequest(Object.assign({},d,{onload:a=>e(new b(a,d)),onerror:a=>e(new b(a,d))}))})});
{
"name": "gmxhr-fetch",
"version": "0.0.2",
"version": "0.0.3",
"description": "fetch-like wrapper for GM_xmlhttpRequest.",

@@ -5,0 +5,0 @@ "main": "gmxhr-fetch.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc