Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,32 @@
Backloader
==========

A Chrome extension to redirect HTTP requests to other URLs
A browser extension to redirect HTTP requests to other URLs
**Firefox WebExtension Compatible!**

Some CDNs are extremely fast in one place and extremely slow or outright blocked in another. When a webpage makes a request for a file from a CDN (Content Delivery Network), Backloader can redirect the request to another, hopefully faster, CDN. This decreases page load time dramatically. In some cases, Backloader will outright block requests for files that aren't needed and are slow in loading (for example, fonts, or scripts that simply allow for compatibility with another browser). **Of course, this can also cause problems, so if you ever experience problems, you should disable Backloader and try again.**

Browser Compatibility
============
| Tested Browsers | Compatibility | Notes |
|------------------------------|---------------|--------------------|
| Google Chrome | 100% |
| Chromium | 100% |
| Firefox Nightly Builds (44) | 90% | Requires work-arounds in-code. Popup doesn't auto-update with the latest information. Tabs appear to be loading infinitely when navigating to a blocked url.
| Opera | 100% |
| Vivaldi (1.0.252.3-snapshot+)| 100% |
| Maxathon | 99% | Requires unsupported manual installation method.

Installation
============

1. Download the latest release from https://github.com/Nateowami/Backloader/releases/latest.
2. Open chrome://extensions/
2. Open chrome://extensions/ or equivalent, according to your browser.
3. Open your downloads folder, or wherever you saved Backloader when you downloaded it.
4. Drag the file (Backloader.crx) from its folder to Chrome on the extensions page.
5. Chrome will ask you to confirm that you want to install the file. Click "Add."
4. Drag the file (Backloader.crx) from its folder to your browser's extensions page.
5. The browser will ask you to confirm that you want to install the file. Click "Add."

That's it! If you experience any issues try disabling Backloader by clicking on the extension's icon and deselecting "Enable redirects and blocking."
That's it! If you experience any issues try disabling Backloader by clicking on the extension's icon and clicking "Disable."

Future Plans
============
Expand Down
27 changes: 27 additions & 0 deletions build/Backloader.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
-----BEGIN RSA P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35D/KeHfY4Nkm5Lw7CoQp1mpeiYyECgYBOJCCD6JiGBDDtHOJni3iS
zqS1KJNU2kbO+Gmts+Yg/YwkxyZKkTR2MRsiU+0l7lXCZlmizzt9CZNRC8+48CkV
GFvDEN2GcZMsVGLNAnxYzp0zeS3m7Kq+dmcocmuWepjrEIdvH1LSvjg2Qb62HnMq
m5RwKndjuYdPzu/7/KKgiQKBgQCle0RJQ8Oe++L7gHQDxSVoYcIlHdPvpqEonPk4
Z84jy1XQSfu6KIALRm+Q47dlPqjXsa2JRpwzkGd2MWkRKZDGx9fRktzEeecXd9ys
zHj5wjCULJnyt2lGSgW/WQ/U20CfaEfnbOZdVVsSJ8f8V5Cw7tUpo5xRHiNVsxx8
nxtQoQKBgQCu2XDfpfpaErJxC2iHCNcq6Tvabb9xpixmsAJW5a9kd1GTrXJEHPqj
sIkxf7scyWR7QVJjezmzsRajxWLPRy/gQlYuqa7QhmX6w6IjBK8xkwSU8Wp0BrFU
rvgAP1xX7U4Do6b30nDqBlvk2NIvcQJvC5wNe80ifVLNX54XBq/uzw==
-----END RSA PRIVATE KEY-----
5 changes: 5 additions & 0 deletions build/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
### Build Instructions
To build the development versions of the extensions, run `./build-dist.sh` in this directory.

### Information
The private key provided is for development builds only and will not be used in published versions of this extension.
24 changes: 24 additions & 0 deletions build/build-dist.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

# Quick'n'dirty bash script for building installable Backloader extension distributions.
# Usage: ./build-dist.sh

rm -rf ../dist
mkdir ../dist

# Build chrome/opera/vivaldi extension
echo "Building signed CRX distributable file."
./crxmake.sh ../src ./Backloader.pem ../dist/Backloader.crx
echo "Built signed CRX distributable file."

echo ""

# Build firefox .xpi
echo "Building unsigned XPI (Mozilla) distributable file."
cd ../src;
zip -r ../dist/Backloader.xpi *
echo "Built unsigned XPI (Mozilla) distributable file."

echo ""

echo "Build complete."
42 changes: 42 additions & 0 deletions build/crxmake.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/bash -e
#
# Purpose: Pack a Chromium extension directory into crx format

if test $# -ne 3; then
echo "Usage: crxmake.sh <extension dir> <pem path> <output path>"
exit 1
fi

dir=$1
key=$2
name=$(basename "$dir")
crx=$3
pub="$name.pub"
sig="$name.sig"
zip="$name.zip"
trap 'rm -f "$pub" "$sig" "$zip"' EXIT

# zip up the crx dir
cwd=$(pwd -P)
(cd "$dir" && zip -qr -9 -X "$cwd/$zip" .)

# signature
openssl sha1 -sha1 -binary -sign "$key" < "$zip" > "$sig"

# public key
openssl rsa -pubout -outform DER < "$key" > "$pub" 2>/dev/null

byte_swap () {
# Take "abcdefgh" and return it as "ghefcdab"
echo "${1:6:2}${1:4:2}${1:2:2}${1:0:2}"
}

crmagic_hex="4372 3234" # Cr24
version_hex="0200 0000" # 2
pub_len_hex=$(byte_swap $(printf '%08xn' $(ls -l "$pub" | awk '{print $5}')))
sig_len_hex=$(byte_swap $(printf '%08xn' $(ls -l "$sig" | awk '{print $5}')))
(
echo "$crmagic_hex $version_hex $pub_len_hex $sig_len_hex" | xxd -r -p
cat "$pub" "$sig" "$zip"
) > "$crx"
echo "Wrote $crx"
Binary file added dist/Backloader.crx
Binary file not shown.
Binary file added dist/Backloader.xpi
Binary file not shown.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 8 additions & 1 deletion manifest.json → src/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@

"name": "Backloader",
"version": "0.2.0",
"description": "A Chrome extension to redirect HTTP requests to other URLs",
"description": "A browser extension to redirect HTTP requests to other URLs",

"permissions": [
"storage",
"unlimitedStorage",
"tabs",
"webRequest",
"webRequestBlocking",
Expand All @@ -24,6 +25,12 @@
"default_title": "Backloader"
},

"applications": {
"gecko": {
"id": "[email protected]"
}
},

"content_scripts": [
{
"matches": [
Expand Down
File renamed without changes.
File renamed without changes.
9 changes: 6 additions & 3 deletions pages/options/options.js → src/pages/options/options.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
var browser = browser || chrome;

var p = photonui;

var options = {
Expand All @@ -10,7 +12,8 @@ var ruleSelection = null;

$(document).ready(function() {
prepareLayout();
chrome.storage.local.get('filter-list', init);
// Arg 1: ['filter-list'] regressed to null for Firefox support.
browser.storage.local.get(null, init);
});

function init(storageResults) {
Expand Down Expand Up @@ -556,7 +559,7 @@ function addEditList(isNew) {
});

// Apply logic
p.getWidget("list-edit-apply").registerCallback("apply", "click", function() {
p.getWidget("list-edit-apply").registerCallback("apply", "click", function() {
var filterObject = {
name: nameField.value,
isEnabled: true,
Expand Down Expand Up @@ -681,7 +684,7 @@ function addEditList(isNew) {
}

function saveList() {
chrome.storage.local.set({
browser.storage.local.set({
"filter-list": filterList,
}, function() {
});
Expand Down
File renamed without changes.
File renamed without changes.
9 changes: 6 additions & 3 deletions pages/popup/popup.js → src/pages/popup/popup.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
var browser = browser || chrome;

var p = photonui;
$(document).ready(function() {
chrome.storage.local.get(["enabled", "redirected", "blocked"], initPopup);
// Arg 1: ['enabled', 'redirected', 'blocked'] regressed to null for Firefox support.
browser.storage.local.get(null, initPopup);
});


Expand All @@ -22,15 +25,15 @@ function initPopup(items) {

enableButton.registerCallback("toggled", "click", function(widget) {
widget.text = widget.value ? "Disable" : "Enable";
chrome.storage.local.set({enabled: widget.value});
browser.storage.local.set({enabled: widget.value});
});

var optionsButton = new p.Button({
textVisible: false,
leftIcon: new p.FAIcon("fa-cog"),
});
optionsButton.registerCallback("open-options", "click", function(widget) {
chrome.tabs.create({url: './pages/options/options.html'});
browser.tabs.create({url: './pages/options/options.html'});
});

controlBox.addChild(enableButton);
Expand Down
Loading