Fix hang saving snapshots on some pages (e.g. permanent Wikipedia URLs)
This commit is contained in:
parent
c0ad18ee28
commit
2145431468
1 changed files with 5 additions and 1 deletions
|
@ -545,16 +545,20 @@ var wpdDOMSaver = {
|
|||
{
|
||||
if ( (WPD_CSSSCROLLBUG) && ( aHTMLText.match(/background:/i)) ) {
|
||||
// Regex fixed by Dan for Zotero
|
||||
//var re = new RegExp(/style=\"(.*)background:(.*)(repeat scroll 0(?:pt|px|%);)/);
|
||||
var re = new RegExp(/style=\"([^\"]*)background:([^;\"]*)(repeat scroll 0(?:pt|px|%);?)/);
|
||||
while ( re.exec( aHTMLText ) ) {
|
||||
var firstPart = RegExp.$1;
|
||||
var secondPart = RegExp.$2;
|
||||
var thirdPart = RegExp.$3.replace(/scroll 0(pt|px|%);/g, ';');
|
||||
// '?' added by Dan for Zotero
|
||||
//var thirdPart = RegExp.$3.replace(/scroll 0(pt|px|%);/g, ';');
|
||||
var thirdPart = RegExp.$3.replace(/scroll 0(pt|px|%);?/g, ';');
|
||||
aHTMLText = aHTMLText.replace(re,"style=\""+firstPart+"background:"+secondPart+thirdPart);
|
||||
}
|
||||
}
|
||||
if ( (WPD_CSSBACKGROUNDPOSITIONBUG) && ( aHTMLText.match(/background-position: /i)) ) {
|
||||
// Regex fixed by Dan for Zotero
|
||||
//var re = new RegExp(/style=\"(.*)background-position: 0(?:pt|px|%);/);
|
||||
var re = new RegExp(/style=\"([^\"]*)background-position: 0(?:pt|px|%);/);
|
||||
while ( re.exec( aHTMLText ) ) {
|
||||
aHTMLText = aHTMLText.replace(re,"style=\""+RegExp.$1+"background-position: ;");
|
||||
|
|
Loading…
Add table
Reference in a new issue