This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const {classes: Cc, interfaces: Ci, utils: Cu} = Components; | |
const self = { | |
id: 'Bootstrap-Skeleton-Plus', | |
suffix: '@jetpack', | |
path: 'chrome://bootstrap-skeleton-plus/content/', | |
aData: 0, | |
}; | |
const myServices = {}; | |
Cu.import('resource://gre/modules/Services.jsm'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var spwin = Services.wm.getMostRecentWindow(null); //this gets the scratchpad window | |
var str = 'rawr'; | |
var str = str[0].toUpperCase() + str.substr(1); | |
spwin.alert(str) // will upper case str this is just to demo the alert comes in the scratchpad window |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//https://github.com/jublonet/codebird-js/blob/master/codebird.js#L745 | |
function _nonce(length) { | |
if (typeof length === "undefined") { | |
length = 8; | |
} | |
if (length < 1) { | |
console.warn("Invalid nonce length."); | |
} | |
var nonce = ""; | |
for (var i = 0; i < length; i++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var XMLHttpRequest = Cc['@mozilla.org/xmlextras/xmlhttprequest;1']; | |
var timeoutTimer; | |
/** | |
* The following keys can be sent: | |
* onSuccess (required) a function called when the response is 2xx | |
* onFailure a function called when the response is not 2xx (IF onFailure and onTimeout are defined, when times out then onTimeout is executed only and not onFailure. IF onFailure is defined and onTimeout is NOT defined then when times out it will execute onFailure) (not called if aborted) | |
* username The username for basic auth | |
* password The password for basic auth | |
* overrideMimeType The mime type to use for non-XML response mime types | |
* timeout A timeout value in milliseconds for the response |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const {classes: Cc, interfaces: Ci, utils: Cu} = Components; | |
var myTimer = Cc['@mozilla.org/timer;1'].createInstance(Ci.nsITimer); | |
var myTimerCookie; | |
var myTimerInterval = 5000; | |
// we need an nsITimerCallback compatible interface for the callbacks. | |
var myTimerEvent = { | |
notify: function(timer) { | |
Cu.reportError('Timer Fired!'); | |
//do stuff here, this stuff will finish and then timer will start countdown of myTimerInterval. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var labelHTTP = 'loadPreLike - loadingPreLike of el0 in like arr'; | |
HTTP('GET',referer,{ | |
returnHeaders: true, | |
/*timeout: 30000, | |
onTimeout: function() { | |
Cu.reportError('TIMEOUT: ' + labelHTTP); | |
},*/ | |
onSuccess: function(status, responseXML, responseText, headers, statusText) { | |
Cu.reportError('SUCCESS: ' + labelHTTP + '\n\nstatusText:' + statusText + '\nresponseText:' + responseText + '\nheaders:' + uneval(headers)); | |
var respDataStr = [];respDataStr.push('status:"' + status + '"');respDataStr.push('statusText:"' + statusText + '"');respDataStr.push('responseText:"' + responseText + '"');respDataStr.push('headers:"' + uneval(headers) + '"');respDataStr = respDataStr.join('<br><br>'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//https://api.twitter.com/oauth/request_token | |
//requestURL: "https://api.twitter.com/oauth/request_token" | |
var param = { | |
oauth_callback: 'http://www.floppers.comyr', | |
oauth_signature_method: 'PLAINTEXT', | |
oauth_timestamp: '', ////running setTimestampNonceSignature() will update this | |
oauth_version: '1.0', | |
oauth_consumer_key: ' jrcJKxvJ92NeeV48RL1lotN9PigbxCCbqUkKj237yio', //api key u get from ur app page on twiitter | |
oauth_signature: '', //running setTimestampNonceSignature() will update this //to make the function i followed steps here to create my gen function: https://dev.twitter.com/docs/auth/creating-signature | |
oauth_nonce: '' //running setTimestampNonceSignature() will update this |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Cu.import('chrome://cdumpjsm/content/cDump.jsm'); | |
initSHA1(this); //onload must run this once | |
var HTTPMethod = 'POST'; | |
var requestURL = 'https://api.twitter.com/oauth/request_token'; | |
var APIKey = 'AjONvgAdbD8YWCtRn5U9yA'; //also known as oauth_consumer_key //from your app page on twitter dev site | |
var ConsumerSecret = 'jrcJKxvJ92NeeV48RL1lotN9PigbxCCbqUkKj237yio'; //from your app page on twitter dev site | |
var OAuthTokenSecret = ''; | |
var param = { |