Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

CRC check toggle in options.

  • Loading branch information...
commit 5cfa5cf5614fb48e0eecafb075a1b0ecdd85545d 1 parent 82374ba
@Dither authored
View
6 README.md
@@ -1,9 +1,9 @@
AutoPatchWork for Opera
==========
-It is the fork of AutoPatchWork ( http://code.google.com/p/autopatchwork/ ).
-This extension automatically loads next page and inserts it into current
-one when you scroll to the end of it.
+It is fork of AutoPatchWork extension ( https://github.com/os0x/AutoPatchWork ).
+This extension automatically loads next page and inserts it into current one
+when scrolling to the end of it.
AutoPatchWork extension derived from AutoPagerize ( http://autopagerize.net ).
View
2  css/options.css
@@ -128,7 +128,7 @@ dt.disabled .key,li.disabled .key{
box-shadow: #CCC 0 0 .25em;
overflow: hidden;
width: 817px;
- height: 260px;
+ height: 287px;
z-index: 2;
margin-top: -2px;
}
View
10 includes/AutoPatchWork.js
@@ -62,6 +62,7 @@ fastCRC32.prototype = {
FORCE_TARGET_WINDOW: true,
DEFAULT_STATE: true,
TARGET_WINDOW_NAME: '_blank',
+ CRC_CHECKING: false,
BAR_STATUS: true,
CHANGE_ADDRESS: false,
PAGES_TO_KEEP: 3,
@@ -210,6 +211,7 @@ fastCRC32.prototype = {
function init(info) {
matched_siteinfo = info.siteinfo;
if (info.config) {
+ options.CRC_CHECKING = info.config.check_crc;
options.BASE_REMAIN_HEIGHT = info.config.remain_height;
options.DEFAULT_STATE = info.config.auto_start;
options.FORCE_TARGET_WINDOW = info.config.target_blank;
@@ -853,7 +855,11 @@ fastCRC32.prototype = {
* */
function get_node_href(node) {
if (!node) return null;
- if (typeof node.getAttribute == 'function' && node.getAttribute('href')) return node.getAttribute('href');
+ if (typeof node.getAttribute == 'function') {
+ if (node.getAttribute('href')) return node.getAttribute('href');
+ else if (node.getAttribute('action')) return node.getAttribute('action');
+ else if (node.getAttribute('value')) return node.getAttribute('value');
+ }
return node.href || node.action || node.value;
}
/**
@@ -957,7 +963,7 @@ fastCRC32.prototype = {
// we can't check for repeating nodes in the same document because
// they can have some function also can't check responseText (earlier) as there
// is a high probability of non-paging content changes like random ad names
- if (nodes.length === 1) {
+ if (nodes.length === 1 && options.CRC_CHECKING) {
var insert_node_crc = checksum.crc(nodes[0].innerHTML);
if (!loaded_crcs[insert_node_crc]) loaded_crcs[insert_node_crc] = true
else return dispatch_event('AutoPatchWork.terminated', { message: 'next page has same crc' });
View
4 options.html
@@ -57,6 +57,10 @@
<label for='disable_iframe' class='MSG_noiframe'>Disable extension in IFRAME tags</label>
</div>
<div>
+ <input type='checkbox' id='check_crc'>
+ <label for='check_crc' class='MSG_check_crc'>Check pages for duplicates by CRC</label>
@Dither Owner
Dither added a note

The reason to disable it when pages loaded empty/similar and external event handlers being used to populate the content. Useful when dealing with js-generated or obfuscated pages.

Maybe will add per site toggle too afterwards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ </div>
+ <div>
<input type='checkbox' id='change_address'>
<label for='change_address' class='MSG_change_address'>Replace location URL when appending</label>
</div>
View
1  scripts/background.js
@@ -41,6 +41,7 @@ window.AutoPatchWorkBG = {
disable_iframe: false,
change_address: false,
debug_mode: false,
+ crc_check: false,
bar_status: 'on'
},
save_custom_patterns: function(patterns) {
Please sign in to comment.
Something went wrong with that request. Please try again.