Skip to content
/ gmxhr Public
forked from damoclark/gmxhr

xmlHttpRequest API wrapper for Greasemonkey's GM_xmlhttpRequest

Notifications You must be signed in to change notification settings

volkirik/gmxhr

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

README

NPM

Description

gmxhr is a xmlHttpRequest API wrapper for Greasemonkey's GM_xmlhttpRequest function.

It provides a xmlHttpRequest API to the GM_xmlhttpRequest function from the Greasemonkey and Tampermonkey WebExtensions for Firefox and Chromium-based browsers. This means it can be used as a drop-in replacement for higher-level libraries and frameworks for the standard xmlHttpRequest class.

Installation

$ npm install gmxhr

Usage

As an example, gmxhr can be used to allow jQuery to perform ajax calls using GM_xmlhttpRequest within a userscript:

var gmxhr = require('gmxhr');

....

$.ajax({
	url: '/p/',
	xhr: function(){return new gmxhr();},
	type: 'POST',
  success: function(val){
		....
	}
 });

Attribution

My thanks to Ryan Greenberg and Martin Monperrus for creating and sharing this code.

About

xmlHttpRequest API wrapper for Greasemonkey's GM_xmlhttpRequest

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%