File tree Expand file tree Collapse file tree
AutoPatchWork.safariextension/includes Expand file tree Collapse file tree Original file line number Diff line number Diff line change 676676 append_point . insertBefore ( root , insert_point ) ;
677677 var docHeight = documentHeight ( ) ;
678678 var docs = get_next_elements ( htmlDoc ) ;
679+ var elementHeight = pageElementHeight ( docs [ docs . length - 1 ] ) ;
679680 var first = docs [ 0 ] ;
680681 if ( ! first ) {
681682 dispatch_event ( 'AutoPatchWork.terminated' , { message : 'The next page\'s pageElement was empty.' } ) ;
699700 docs [ i ] = insert_node ;
700701 } ) ;
701702 if ( status . bottom ) status . bottom . style . height = Root . scrollHeight + 'px' ;
702- if ( docHeight === documentHeight ( ) ) {
703+ if ( elementHeight === pageElementHeight ( docs [ docs . length - 1 ] ) && docHeight === documentHeight ( ) ) {
703704 return dispatch_event ( 'AutoPatchWork.error' , { message : 'missing next page contents' } ) ;
704705 }
705706 next = get_next ( htmlDoc ) ;
724725 function documentHeight ( ) {
725726 return Math . max ( document . documentElement . scrollHeight , document . body . scrollHeight )
726727 }
728+
729+ function pageElementHeight ( element ) {
730+ return element . parentNode . scrollHeight ;
731+ }
727732
728733 function createXHTML ( str ) {
729734 return new DOMParser ( ) . parseFromString ( str , 'application/xhtml+xml' ) ;
You can’t perform that action at this time.
0 commit comments