Skip to content

Instantly share code, notes, and snippets.

@erikvold
Last active December 18, 2015 19:49
Show Gist options
  • Select an option

  • Save erikvold/5835884 to your computer and use it in GitHub Desktop.

Select an option

Save erikvold/5835884 to your computer and use it in GitHub Desktop.
Fx redirect example using jetpack
'use strict';
const { data } = require('sdk/self');
// Using the redirect module from the pathfinder package https://github.com/erikvold/addon-pathfinder/blob/master/lib/redirect.js
const { Redirect } = require('pathfinder/redirect');
Redirect({
from: "http://ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js",
to: 'data:text/javascript;charset=utf-8,' + encodeURIComponent(data.load('ajax/libs/jquery/2.0.2/jquery.min.js'))
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment