Fix hang saving snapshots on some pages (e.g. permanent Wikipedia URLs)
This commit is contained in:
parent
ddc348531f
commit
fdfc153f4c
|
@ -545,16 +545,20 @@ var wpdDOMSaver = {
|
||||||
{
|
{
|
||||||
if ( (WPD_CSSSCROLLBUG) && ( aHTMLText.match(/background:/i)) ) {
|
if ( (WPD_CSSSCROLLBUG) && ( aHTMLText.match(/background:/i)) ) {
|
||||||
// Regex fixed by Dan for Zotero
|
// 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|%);?)/);
|
var re = new RegExp(/style=\"([^\"]*)background:([^;\"]*)(repeat scroll 0(?:pt|px|%);?)/);
|
||||||
while ( re.exec( aHTMLText ) ) {
|
while ( re.exec( aHTMLText ) ) {
|
||||||
var firstPart = RegExp.$1;
|
var firstPart = RegExp.$1;
|
||||||
var secondPart = RegExp.$2;
|
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);
|
aHTMLText = aHTMLText.replace(re,"style=\""+firstPart+"background:"+secondPart+thirdPart);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( (WPD_CSSBACKGROUNDPOSITIONBUG) && ( aHTMLText.match(/background-position: /i)) ) {
|
if ( (WPD_CSSBACKGROUNDPOSITIONBUG) && ( aHTMLText.match(/background-position: /i)) ) {
|
||||||
// Regex fixed by Dan for Zotero
|
// 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|%);/);
|
var re = new RegExp(/style=\"([^\"]*)background-position: 0(?:pt|px|%);/);
|
||||||
while ( re.exec( aHTMLText ) ) {
|
while ( re.exec( aHTMLText ) ) {
|
||||||
aHTMLText = aHTMLText.replace(re,"style=\""+RegExp.$1+"background-position: ;");
|
aHTMLText = aHTMLText.replace(re,"style=\""+RegExp.$1+"background-position: ;");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user