HEAD is quicker, but sometimes doesn't reflect the true HTTP status of a page, use GET if you're getting weird results. GET is required to be able to parse the document for an element corresponding to what is after the hashtag by ID.
+
+
+
0 means no limit.
+
When enabled, if the url of the current tab changes and the page is loaded, it will automatically be checked. Valid link caching is recommended when this is enabled.
Warnings
diff --git a/options.js b/options.js
index f46ea98..e1dea86 100755
--- a/options.js
+++ b/options.js
@@ -53,6 +53,7 @@ function loadOptions() {
break;
}
}
+ document.getElementById("rps").value = options.rps;
});
}
@@ -64,6 +65,7 @@ function saveOptions() {
// Save selected options to localstore
bkg.setItem("blacklist", blacklistEntries.value);
bkg.setItem("checkType", requestType.children[requestType.selectedIndex].value);
+ bkg.setItem("rps", document.getElementById("rps").value);
if (document.getElementById("cache").checked) { bkg.setItem("cache", 'true'); } else { bkg.setItem("cache", 'false'); }
if (document.getElementById("noFollow").checked) { bkg.setItem("noFollow", 'true'); } else { bkg.setItem("noFollow", 'false'); }
diff --git a/tests/tests.js b/tests/tests.js
index 0dccbfc..566e364 100644
--- a/tests/tests.js
+++ b/tests/tests.js
@@ -335,6 +335,7 @@ QUnit.module("Options", {
QUnit.test("test the getOption function do not default", function(assert) {
window.localStorage.getItem.withArgs("blacklist").returns("http://example.com/");
window.localStorage.getItem.withArgs("checkType").returns("GET");
+ window.localStorage.getItem.withArgs("rps").returns("30");
window.localStorage.getItem.withArgs("cache").returns("true");
window.localStorage.getItem.withArgs("noFollow").returns("true");
window.localStorage.getItem.withArgs("parseDOM").returns("true");
@@ -344,6 +345,7 @@ QUnit.test("test the getOption function do not default", function(assert) {
window.localStorage.getItem.withArgs("optionsURL").returns("true");
assert.equal(getOption("blacklist"), "http://example.com/", "Testing the option value of blacklist is retrieved from LocalStorage");
assert.equal(getOption("checkType"), "GET", "Testing the option value of checkType is retrieved from LocalStorage");
+ assert.equal(getOption("rps"), "30", "Testing the option value of rps is retrieved from LocalStorage");
assert.equal(getOption("cache"), "true", "Testing the option value of cache is retrieved from LocalStorage");
assert.equal(getOption("noFollow"), "true", "Testing the option value of noFollow is retrieved from LocalStorage");
assert.equal(getOption("parseDOM"), "true", "Testing the option value of parseDOM is retrieved from LocalStorage");
@@ -366,6 +368,7 @@ QUnit.test("test the getOption function Defaults", function(assert) {
"adservices.google.com\n" +
"appliedsemantics.com", "Testing the default value of blacklist");
assert.equal(getOption("checkType"), "GET", "Testing the default value of checkType");
+ assert.equal(getOption("rps"), "30", "Testing the default value of rps");
assert.equal(getOption("cache"), "false", "Testing the default value of cache");
assert.equal(getOption("noFollow"), "false", "Testing the default value of noFollow");
assert.equal(getOption("parseDOM"), "false", "Testing the default value of parseDOM");
@@ -382,6 +385,7 @@ QUnit.test("test the getOptions function Defaults", function(assert) {
getOptions();
assert.equal(window.getOption.withArgs("blacklist").calledOnce, true, "getOption blacklist is called");
assert.equal(window.getOption.withArgs("checkType").calledOnce, true, "getOption checkType is called");
+ assert.equal(window.getOption.withArgs("rps").calledOnce, true, "getOption rps is called");
assert.equal(window.getOption.withArgs("cache").calledOnce, true, "getOption cache is called");
assert.equal(window.getOption.withArgs("noFollow").calledOnce, true, "getOption noFollow is called");
assert.equal(window.getOption.withArgs("parseDOM").calledOnce, true, "getOption parseDOM is called");