Author Topic: Popups to links - Need help  (Read 5903 times)

lnminente

  • Jr. Member
  • **
  • Posts: 73
    • ICQ Messenger -
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • Email
Popups to links - Need help
« on: August 12, 2002, 07:28:10 PM »
Hi all.

I like to see what proxomitrom is filtering in the same web without passing for the log window.

Also, some webs needs that we follow the popups .
For example:   www.dots.everyday.com

This filter, dont quit popups. The popups are filtered by "Smart pop-up windows killer"

Then, i make this filter. Lets test it:

Name = "Popups to links"
Active = TRUE
Limit = 5120
Match = "(<script*window.open(*($AV(http://w|/w))2*,*)*</script>)1"
Replace = "1 <a href=2><font size=1 color=red>[POPUP]</font></a>"



Edited by - lnminente on 22 Aug 2002  18:37:33
 

lnminente

  • Jr. Member
  • **
  • Posts: 73
    • ICQ Messenger -
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • Email
Popups to links - Need help
« Reply #1 on: August 12, 2002, 07:50:34 PM »
The filter before, was giving me 100%CPU in www.nokia.com, i modified it:

Name = "Popups to links"
Active = TRUE
Bounds = "$NEST(<script,</script*>)"
Limit = 5120
Match = "1(window.open(*($AV(http://w|/w))2*,*))3"
Replace = "1 3 <a href=2><font size=1 color=red>[POPUP]</font></a>"

Edited by - lnminente on 12 Aug 2002  20:51:22
 

lnminente

  • Jr. Member
  • **
  • Posts: 73
    • ICQ Messenger -
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • Email
Popups to links - Need help
« Reply #2 on: August 22, 2002, 05:35:34 PM »
Hi all. This is my new attempt:

NEED HELP to get working this filter, i don't know javascript:

Name = "Popups to buttons"
Active = TRUE
URL = "$TYPE(htm)(^$LST(Bypass-Start-End)|$LST(Allow-JS))"
Limit = 8
Match = "<start>"
Replace = "
 <SCRIPT LANGUAGE=JavaScript>"
          "window.open = document.write("
          "<input type="Button" value="POPUP" onclick="window.open(url);return(false)">"
          "); </SCRIPT>
"

Regards.

Edited by - lnminente on 22 Aug 2002  18:36:31
 

sidki3003

  • Sr. Member
  • ****
  • Posts: 476
    • ICQ Messenger -
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • http://
    • Email
Popups to links - Need help
« Reply #3 on: August 22, 2002, 05:46:55 PM »
You may want to take a look at Paul Rupe's end.js .
There he creates buttons for window.onload and window.onunload events.

http://www.geocities.com/u82011729/prox/filter.html#tamescripts


 
 

lnminente

  • Jr. Member
  • **
  • Posts: 73
    • ICQ Messenger -
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • Email
Popups to links - Need help
« Reply #4 on: August 22, 2002, 06:57:12 PM »
Hi Sidki.

Thanks for the web, is very good.

I have been treatening to understand the filters, but, at the moment,
its too difficult for me.

Regards.

Edited by - lnminente on 22 Aug 2002  19:58:13
 

TEggHead

  • Jr. Member
  • **
  • Posts: 93
    • ICQ Messenger - 21893433
    • AOL Instant Messenger -
    • Yahoo Instant Messenger - eljarec
    • View Profile
    • Email
Popups to links - Need help
« Reply #5 on: August 22, 2002, 09:10:59 PM »
Hold It! <brake>pedal to the metal</brake> screeching halt here...drop all you got sofar and go waaaaaay backto the problem.

No need to go and try to change calls to links, first of all, call may be smack in the middle of a script, embedding links in script usually causes tremendous problems for the script...so a dead end for your problem

If I understand correct, you need to have popups allowed on _some_ sites, but they are filtered by the "Smart Popup Killer"? Then why not simply add an exception list to Proxo's blocklistcollection and use it to match in the URL field for URLs that need to skip the popupfilter?

using NoPoppers as examplename, add this into the URL field of the popup killer

(^*$LST(NoPoppers)*)

You will have to create a new textfile and add it to Proxo using an appriopriate name, you can then add needed part of a URL string into this file to skip the filter for these. Because of the wildcards in the call format, entries in this list can be as global as whole domain e.g.

.everyday.com

or as restrictive as e.g.

www.dots.everyday.com/take/a/tour/through/the/site/roadmap.

as for your first question, do you mean view original page and dbug output for same page at same time?

If you use IE, try this one...


Name = "Start: Automatic dbug Output in Search Pane (JarC)"
Active = TRUE
Limit = 1
Match = "<start>"
Replace = "<SCRIPT CLASS=ShonenScript LANGUAGE=JavaScript>"
          "window.open("http://dbug.."+"
          "document.location.href.substring(7),"_search");void(0);</SCRIPT>
"




 
 

lnminente

  • Jr. Member
  • **
  • Posts: 73
    • ICQ Messenger -
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • Email
Popups to links - Need help
« Reply #6 on: August 22, 2002, 10:29:44 PM »
Hi TEggHead.

You understood correct: I need to have popups allowed on some sites, but they are filtered by the "Smart Popup Killer".

I know that i can use a list, i made me the filter "Kill offsite images on selected pages". But don't like this solution. I preffer one more general solution for popups.

I believe the better way is replacing ".open" for a button function. I know that with onclick=window.open, i would need to click the new button click othertime. But it is the better solution i can imagine.

Sorry, i dont understand this:
quote:
embedding links in script usually causes tremendous problems for the script...so a dead end for your problem


I like "Start: Automatic dbug Output in Search Pane (JarC)".

But when i said that i like to see what i am filtering , i was treating to
say that i like to replace iframes,frames,flash objects,background sounds etc
to links. And i would like also, to replace popups to a button or a link.

Well, that's all by the moment.
Many thanks.

Edited by - lnminente on 22 Aug 2002  23:31:37
 

TEggHead

  • Jr. Member
  • **
  • Posts: 93
    • ICQ Messenger - 21893433
    • AOL Instant Messenger -
    • Yahoo Instant Messenger - eljarec
    • View Profile
    • Email
Popups to links - Need help
« Reply #7 on: August 22, 2002, 11:50:28 PM »
Hi Inminente

quote:

Sorry, i dont understand this:
quote:

embedding links in script usually causes tremendous problems for the script...so a dead end for your problem



Well, you want to replace window.open(something) with a button or link that you can click on. Right?

Ok, now, the problem is that window.open is a javascript command that _can_ exist as part of an onclick= or href=  value, you could try and onvert these safely as long as you use the correct bounds. On the other hand, the call does not need to be directly to window.open(), but could also be itself a call to a wrapper function with any name, testing some specifics first (similar as filter window.open replacement), in which case your filter will not see it as a window.open call since the call can be named anything then.

However, the majority of window.open calls will be found in javascript blocks (such as in the case of above wrapper example), either inline in the page or loaded from an external source. Now there's a lot javascript can do, but alas, it can not stand the presence of a raw htmltag, smack in the middle of a script source.

consider the following example
<script language=javascript>
// lots of javascript
if(some_logic) {window.open(somewhere);}
// lots of javascript
</script>

if you were to replace this window.open with either button/link, then it would end up looking like

<script language=javascript>
// lots of javascript
if(some_logic) {<a href="somewhere">popup</a>}
// lots of javascript
</script>

this would generate a javascript error at the least, and at the worst prevent replacement code (such as scripts inserted at <end>) to function at all. It might also cause a page to not load correctly or load only partly.

You could compare it with opening an executable file in worpad, type some straight ascii in the middle, save the file and expecting it to run without any problem...

This is not typical for window.open but for the whole of javascript. For a filter to safely take out something which can live in both regular html and script, takes special considerations to prevent the additonal problems.

function calls like window.open are particularly hard to filter as they can exist anywhere in both regular html and external javascripts. and it doesn't even have to be window.open, it could also be just open...

pfew, I'm glad my name ain't Basil...





Edited by - TEggHead on 23 Aug 2002  00:54:07
 

lnminente

  • Jr. Member
  • **
  • Posts: 73
    • ICQ Messenger -
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • Email
Popups to links - Need help
« Reply #8 on: August 23, 2002, 03:37:43 PM »
Yes, now i understand you. Thanks.

Not problem then with my first and second filter. They do that with "multi" enabled (it's a safe way i think):

<script language=javascript>
// lots of javascript
if(some_logic) {window.open(somewhere);}
// lots of javascript
</script>
<a href="somewhere">popup</a>

Regards.



Edited by - lnminente on 23 Aug 2002  16:38:39
 

Håkon

  • Newbie
  • *
  • Posts: 1
    • ICQ Messenger -
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • Email
Popups to links - Need help
« Reply #9 on: August 30, 2002, 01:32:34 PM »
What if the popup is between <head> and </head>?

 
 

lnminente

  • Jr. Member
  • **
  • Posts: 73
    • ICQ Messenger -
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • Email
Popups to links - Need help
« Reply #10 on: August 30, 2002, 02:43:53 PM »
Hi and thanks H?kon.

I am not sure.

This filter is provisional. Would be better in javascript.