New User? Need help? Click here to register for free! Registering removes the advertisements.

Computer Cops
image image image image image image image image
Donations
If you found this site helpful, please donate to help keep it online
Don't want to use PayPal? Try our physical address
image
Prime Choice
· Head Lines
· Advisories (All)
· Dnld of the Week!
· CCSP News Ltrs
· Find a Cure!

· Ian T's (AR 24)
· Marcia's (CO8)
· Bill G's (CO12)
· Paul's (AR 5)
· Robin's (AR 2)

· Ian T's Archive
· Marcia's Archive
· Bill G's Archive
· Paul's Archive
· Robin's Archive
image
Security Central
· Home
· Wireless
· Bookmarks
· CLSID
· Columbia
· Community
· Downloads
· Encyclopedia
· Feedback (send)
· Forums
· Gallery
· Giveaways
· HijackThis
· Journal
· Members List
· My Downloads
· PremChat
· Premium
· Private Messages
· Proxomitron
· Quizz
· RegChat
· Reviews
· Google Search
· Sections
· Software
· Statistics
· Stories Archive
· Submit News
· Surveys
· Top
· Topics
· Web Links
· Your Account
image
CCSP Toolkit
· Email Virus Scan
· UDP Port Scanner
· TCP Port Scanner
· Trojan TCP Scan
· Reveal Your IP
· Algorithms
· Whois
· nmap port scanner
· IPs Banned [?]
image
Survey
How much can you give to keep Computer Cops online?

$10 up to $25 per year?
$25 up to $50 per year?
$10 up to $25 per month?
$25 up to $50 per month?
More than $50 per year?
More than $50 per month?
One time only?
Other (please comment)



Results
Polls

Votes: 1155
Comments: 21
image
Translate
English German French
Italian Portuguese Spanish
Chinese Greek Russian
image
 Forum FAQForum FAQ   SearchSearch   UsergroupsUsergroups   ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin 

filter included javascript file

 
Post new topic   Reply to topic       Computer Cops Forum Index -> Proxo Filters
View previous topic :: View next topic  
Author Message
theSurfer

Cadet
Cadet



Joined: May 20, 2004
Posts: 5
Location: Denmark

PostPosted: Mon May 31, 2004 11:43 am    Post subject: filter included javascript file
Reply with quote

There is an external JavaScript file, in which I wish to remove a comment.. this is done by removing the "/*" and "*/", or by replacing both with "/**/".

Here is my Proxomitron-code:

[Patterns]
Name = "eksperten.dk konto menu"
Active = TRUE
URL = "http://www.eksperten.dk/js/coolmenus/exp_menu.js"
Limit = 4096
Match = "/\* | \*/"
Replace = "/\*\*/"


or


[Patterns]
Name = "eksperten.dk konto menu"
Active = TRUE
URL = "http://www.eksperten.dk/js/coolmenus/exp_menu.js"
Limit = 4096
Match = "/\* | \*/"
Replace = ""


The section is:

// konto
oM.makeMenu('m5','','Konto','/konto.phtml','',50);
/*
oM.makeMenu('m5_0','m5','Konto','/konto.phtml');
oM.makeMenu('m5_1','m5','Personlige data','/konto.phtml?option=1');
oM.makeMenu('m5_2','m5','Kategori abonnering','/konto.phtml?option=3');
oM.makeMenu('m5_3','m5','Kategori opsætning','/konto.phtml?option=9');
oM.makeMenu('m5_4','m5','E-Mail abonnering','/konto.phtml?option=4');
oM.makeMenu('m5_5','m5','E-Mail robot','/konto.phtml?option=5');
oM.makeMenu('m5_6','m5','Generelle indstillinger','/konto.phtml?option=8');
oM.makeMenu('m5_7','m5','Minisite & Statement','/konto.phtml?option=6');
oM.makeMenu('m5_8','m5','CoAdmin','/konto.phtml?option=10');
oM.makeMenu('m5_9','m5','Box indstillinger','/konto.phtml?option=11');
oM.makeMenu('m5_10','m5','Reklamer','/konto.phtml?option=12');
oM.makeMenu('m5_11','m5','Spørgsmål indstillinger','/konto.phtml?option=13');
oM.makeMenu('m5_12','m5','Pro udløbsdato','/konto.phtml?option=14');
oM.makeMenu('m5_13','m5','Spørgsmål besvaret af dig','/konto.phtml?option=21');
oM.makeMenu('m5_14','m5','Spørgsmål oprettet af dig','/konto.phtml?option=22');
oM.makeMenu('m5_15','m5','Spørgsmål hvor du deltager','/konto.phtml?option=23');
oM.makeMenu('m5_16','m5','Point regnskab','/konto.phtml?option=24');
*/
switch ($section) {


I saved the position of the section to a HTML file, and it turned out to be about 3.5 kb into the .js file, hence the Limit = 4096. The test works fine.. even with a Limit = 2.


My questions:
1) It is not working.. What is wrong?
2) How does the "Limit" work? (I have read the Help, pressing F1 > clicking on "Byte limit", but didnt understand it)


I Hope You can help.
theSurfer.
Back to top
View users profile Send private message
z12

Sergeant
Sergeant



Joined: Jul 17, 2002
Posts: 131
Location: USA

PostPosted: Tue Jun 01, 2004 11:54 am    Post subject:
Reply with quote

Hi theSurfer,

The reason it doesn't work is the url match, don't include the protocol, enter it like so:

Code:

www.eksperten.dk/js/coolmenus/exp_menu.js


The byte limit specifies the maximum number of bytes to check before giving up trying to match. Since your matching expression is only 2 bytes long, that is all you need for a byte limit.

If this script contained other comments that you didn't want to match, you would have to modify your matching expression to include some of the code (all of it or partial with wild card) within the comment to insure that only this comment is filtered. The code would also need to be captured so it could be included in the replacment text and the Byte Limit would have to raised since now your matching many characters.

HTH
Mike

PS the proxomitron general forum is a better place for questions like this.
Back to top
View users profile Send private message
theSurfer

Cadet
Cadet



Joined: May 20, 2004
Posts: 5
Location: Denmark

PostPosted: Tue Jun 01, 2004 6:17 pm    Post subject:
Reply with quote

Thank you! Thank you! Thank you! It works great! Smile

I tried to make it more specific.. like trying to match:

/*
oM.makeMenu('m5_0'

..since it only appears once.. but I was unable to match "newline" ("\n" ?).. I also ran into trouble when I used the "('" part.. It even failed when I tried to escape them using "\"..

Any ideas on making it more specific?
The owner, of the site, could include some more comments, which my filter would interfere with..

Thanks for the help!
- theSurfer.


PS: Sorry for posting in the wrong forum.. my first post..

PPS: I'm from Denmark, Europe.. my English might be a little off Smile
Back to top
View users profile Send private message
z12

Sergeant
Sergeant



Joined: Jul 17, 2002
Posts: 131
Location: USA

PostPosted: Tue Jun 01, 2004 9:29 pm    Post subject:
Reply with quote

Hi theSurfer,

Here, try this:
Code:

Matching Expression:
(oM.makeMenu\('m5','','Konto','/konto.phtml','',50\);*[\n\r]+)\1
\/\*[^\n\r]+\2\*\/

Replacement Text:
\1\2

Byte Limit:
4096


HTH
Mike

PS: no problem about the post Smile

PPS: your english is good!
Back to top
View users profile Send private message
theSurfer

Cadet
Cadet



Joined: May 20, 2004
Posts: 5
Location: Denmark

PostPosted: Mon Jun 07, 2004 11:51 am    Post subject:
Reply with quote

Hi Mike.

I apologize for the delay.
I have several ongoing projects, plus I help users with their IT-related problems, at www.eksperten.dk (Danish site for people seeking help with their IT-related problems.. the translation function is ineffective). Sometimes when I am checking HijackThis logs, I end up on computercops.biz, which I find funny Smile.

Your RegExp code works great.
I have teamed up with a fellow helper to develop a better menu.

Therefore I am very pleased with Proxomitron, which can do what I have been looking for, since I first tried the filtering function in Mozilla FireFox (browser, http://www.mozilla.org/products/firefox/ ). It was able to filter out ads and so on using CSS3 code.

Using proxomitron, and Your RegExp code, I am able to implement a better menu, on my computer, without bothering others with it.

Thank You for Your help in improving my experience with www.eksperten.dk.


Regards,
theSurfer.
Back to top
View users profile Send private message
Display posts from previous:   
Post new topic   Reply to topic       Computer Cops Forum Index -> Proxo Filters All times are GMT - 5 Hours
Page 1 of 1

 
 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB 2.0.8a © 2001 phpBB Group

Version 2.0.6 of PHP-Nuke Port by Tom Nitzschner © 2002 www.toms-home.com
Version 2.2 by Paul Laudanski © 2003-2004 Computer Cops