#include #include "JavaScript.h" FilterGroup JavaScript::m_fgURLs; JavaScript::JavaScript(TIPsDatabase *_db, InternetURIRequest *_ir, const char *_body, const int _responseCode, const char *_ifModifiedSince, const bool _manageBuffer): InternetResource(_db, _ir, _body, _responseCode, _ifModifiedSince, 0, _manageBuffer) { //these will be cleared on destruction of the program (static) if (!m_fgURLs.size()) { DEBUGPRINT("[%s]: JavaScript static load of [fltsURLs]", DEBUG_LINE, m_ir->domain()->m_domain); m_fgURLs.addFilter(new Filter(59,20,"document.location *= *['\"]([^\"' <>,)]{1,1024})","\\1",0,"JavaScript",regex::NOCASE,false)); m_fgURLs.addFilter(new Filter(68,40,"window.open\\(['\"]([^\"'<>, )]{1,1024})","\\1",0,"popups",regex::NOCASE,false)); m_fgURLs.addFilter(new Filter(70,50,"http://[^ \"'<>)]{1,1024}","\\1",0,"absolute links",regex::NOCASE,false)); } memoryDelta((int)sizeof(JavaScript), this); //inform the domain which will, in turn, inform the Spider } JavaScript::~JavaScript() { memoryDelta(-(int)sizeof(JavaScript), this); //inform the domain which will, in turn, inform the Spider } vector *JavaScript::links() { return InternetResource::links(&m_fgURLs); }