File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 55use Proxy \Plugin \AbstractPlugin ;
66use Proxy \Event \ProxyEvent ;
77use Proxy \Config ;
8+ use Proxy \Html ;
89
910class ProxifyPlugin extends AbstractPlugin {
1011
@@ -138,6 +139,19 @@ public function onCompleted(ProxyEvent $event){
138139 return ;
139140 }
140141
142+ // remove JS from urls
143+ $ js_remove = Config::get ('js_remove ' );
144+ if (is_array ($ js_remove )){
145+ $ domain = parse_url ($ this ->base_url , PHP_URL_HOST );
146+
147+ foreach ($ js_remove as $ pattern ){
148+ if (strpos ($ domain , $ pattern ) !== false ){
149+ $ str = Html::remove_scripts ($ str );
150+ break ;
151+ }
152+ }
153+ }
154+
141155 // let's remove all frames?? does not protect against the frames created dynamically via javascript
142156 $ str = preg_replace ('@<iframe[^>]*>[^<]*< \\/iframe>@is ' , '' , $ str );
143157
You can’t perform that action at this time.
0 commit comments