[prev in list] [next in list] [prev in thread] [next in thread] 

List:       privoxy-developers
Subject:    [privoxy-devel] [ ijbswa-Bugs-1124071 ] window.status replac. not
From:       "SourceForge.net" <noreply () sourceforge ! net>
Date:       2006-12-20 3:04:18
Message-ID: E1Gwrkg-0005HX-Lo () sc8-sf-web6 ! sourceforge ! net
[Download RAW message or body]

Bugs item #1124071, was opened at 2005-02-16 10:46
Message generated for change (Comment added) made by jdmx
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=111118&aid=1124071&group_id=11118

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
> Category: funct: filtering
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
> Assigned to: Justin McMurtry (jdmx)
Summary: window.status replac. not compatible with evaluation usage

Initial Comment:
OS: some linux, sorry, dunno exactly, but not relevant imo anyway
Version: 3.0.3
Browser: Windows Mozilla 1.7.3 Gecko/20040910, Windows IE SP2 2800
Prio: something not really high, 5 seems to be a popular choice innit ;)

Problem: default filter for window.status replacement makes javascript code broke if \
the given piece is actually being evaluated (stands on the right side of an \
assignment).

Example:

original:
  var backupWindowStatus = window.status = 'something';
output (resulting in parse error):
  var backupWindowStatus = window.status = if(typeof(this.href) != 'undefined') \
window.status = 'something' + ' URL: ' + this.href;else return false; expected:
  var backupWindowStatus = window.status = (typeof(this.href) != \
'undefined')?('something' + ' URL: ' + this.href):(window.status);

Notice that in the last piece if the context is not an URL, the status is not altered \
at all.

This is done with the following scary regex:

s/([\W]\s*)((this|window)\.(default)?status)\s*=\s*((['"]).*?\6)/$1$2 = \
(typeof(this.href) != 'undefined')?($5 + ' URL: ' + this.href):($2)/ig

All yours. :) Although not tested throughly with many sites, I shall add.

BTW, if this is embedded into an onclick='', the inline '' will break that tag, so \
the quotation char used should be extracted into a variable and used all throughout \
this regex, imo.


Best regards:
Bor Gergely
borg@infor.hu


----------------------------------------------------------------------

> Comment By: Justin McMurtry (jdmx)
Date: 2006-12-19 21:04

Message:
Logged In: YES 
user_id=973178
Originator: NO

This bug report was submitted 22 months ago, and there've been a lot of
revisions to default.filter since then... wonder if the problem has been
fixed?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=111118&aid=1124071&group_id=11118

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Ijbswa-developers mailing list
Ijbswa-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ijbswa-developers


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic