commit 214543146849c83c5933510d8133842e333f9cec
parent c0ad18ee289bd10899d238dd9d5d9c00db422e1f
Author: Dan Stillman <dstillman@zotero.org>
Date: Tue, 30 Oct 2007 00:33:38 +0000
Fix hang saving snapshots on some pages (e.g. permanent Wikipedia URLs)
Diffstat:
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/chrome/content/zotero/webpagedump/domsaver.js b/chrome/content/zotero/webpagedump/domsaver.js
@@ -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: ;");