diff --git a/app/HtmlDocument.php b/app/HtmlDocument.php index 065913b9aaeac9e31f82c45a16e18c246671c398..206b446f8f706ead7d97efb9731368215cd2106d 100644 --- a/app/HtmlDocument.php +++ b/app/HtmlDocument.php @@ -238,6 +238,29 @@ class HtmlDocument extends Document $style->nodeValue = $cssElement->getResult(); } + foreach ($dom->getElementsByTagName("noscript") as $noscript) { + $this->DOMRemove($noscript); + + } + + # Nun alle Video Tags + foreach ($dom->getElementsByTagName("video") as $video) { + if ($video->hasAttribute("src")) { + # Convert all relative Links to absolute Ones + $video->setAttribute("src", $this->convertRelativeToAbsoluteLink($video->getAttribute("src"))); + # Convert all Links to the proxified Version + # All of this Links should NOT target to the top Level + $video->setAttribute("src", $this->proxifyUrl($video->getAttribute("src"), false)); + } + if ($video->hasAttribute("poster")) { + # Convert all relative Links to absolute Ones + $video->setAttribute("poster", $this->convertRelativeToAbsoluteLink($video->getAttribute("poster"))); + # Convert all Links to the proxified Version + # All of this Links should NOT target to the top Level + $video->setAttribute("poster", $this->proxifyUrl($video->getAttribute("poster"), false)); + } + } + # Abschließend gehen wir noch einmal alle Tags durch foreach ($dom->getElementsByTagName('*') as $el) { if ($el->getAttribute("style") !== "") { @@ -270,4 +293,14 @@ class HtmlDocument extends Document { $link->setAttribute("target", $newTarget); } + + private function DOMRemove(\DOMNode $from) + { + $sibling = $from->firstChild; + do { + $next = $sibling->nextSibling; + $from->parentNode->insertBefore($sibling, $from); + } while ($sibling = $next); + $from->parentNode->removeChild($from); + } } diff --git a/app/Http/Controllers/ProxyController.php b/app/Http/Controllers/ProxyController.php index 3bb75c413be67e260534fd4a1c2496602f9de2bc..338c7fe39bebdea566ce2141223793b44c9b0291 100644 --- a/app/Http/Controllers/ProxyController.php +++ b/app/Http/Controllers/ProxyController.php @@ -178,6 +178,7 @@ class ProxyController extends Controller case 'font/eot': case 'image/vnd.microsoft.icon': case 'application/vnd.ms-fontobject': + case 'application/x-font-ttf': # Nothing to do with Images: Just return them break; case 'text/css':