public
Description: a userscript for auto loading paginated web pages
Homepage: http://userscripts.org/scripts/show/8551
Clone URL: git://github.com/swdyh/autopagerize.git
Click here to lend your support to: autopagerize and make a donation at www.pledgie.com !
 * use finalUrl.
 * don't reload first page.
swdyh (author)
Mon Jul 07 23:10:35 -0700 2008
commit  709f67b9520920aecea72f0ab003a9f9fcc5ee08
tree    22171793cb6ac1d2cc8c3711c25e9f12dc19c0a4
parent  0f5150c8e83017b4700db16c5e0f517817cdaf20
...
93
94
95
 
96
97
98
...
212
213
214
215
 
216
217
218
...
242
243
244
245
 
246
247
248
 
 
 
 
249
250
251
...
355
356
357
358
359
 
 
360
361
362
...
93
94
95
96
97
98
99
...
213
214
215
 
216
217
218
219
...
243
244
245
 
246
247
248
249
250
251
252
253
254
255
256
...
360
361
362
 
 
363
364
365
366
367
0
@@ -93,6 +93,7 @@ var AutoPager = function(info) {
0
 
0
     this.requestURL = url
0
     this.loadedURLs = {}
0
+ this.loadedURLs[location.href] = true
0
     var toggle = function() {self.stateToggle()}
0
     this.toggle = toggle
0
     GM_registerMenuCommand('AutoPagerize - on/off', toggle)
0
@@ -212,7 +213,7 @@ AutoPager.prototype.request = function() {
0
         return
0
     }
0
 
0
- if ( !this.canHandleCrossDomainRequest() ) {
0
+ if (!this.canHandleCrossDomainRequest()) {
0
         return
0
     }
0
 
0
@@ -242,10 +243,14 @@ AutoPager.prototype.showLoading = function(sw) {
0
 }
0
 
0
 AutoPager.prototype.requestLoad = function(res) {
0
- if ( !this.canHandleCrossDomainRequest() ) {
0
+ if (!this.canHandleCrossDomainRequest()) {
0
         return
0
     }
0
 
0
+ if (res.finalUrl) {
0
+ this.requestURL = res.finalUrl
0
+ }
0
+
0
     var t = res.responseText
0
     var htmlDoc = createHTMLDocumentByString(t)
0
     AutoPager.documentFilters.forEach(function(i) {
0
@@ -355,8 +360,8 @@ AutoPager.prototype.getNextURL = function(xpath, doc) {
0
     }
0
 }
0
 
0
-AutoPager.prototype.canHandleCrossDomainRequest = function(url) {
0
- if ( !supportsFinalUrl() ) {
0
+AutoPager.prototype.canHandleCrossDomainRequest = function() {
0
+ if (!supportsFinalUrl()) {
0
         if (!isSameDomain(this.requestURL)) {
0
             this.error()
0
             return false

Comments

    No one has commented yet.