From 98f99725d698fe72090087442a72a5bd17c29fa8 Mon Sep 17 00:00:00 2001 From: emkael Date: Tue, 30 Jan 2018 02:32:14 +0100 Subject: Replacing refresh with JS refresh to preserve state (e.g. hash) of the refreshed frame --- tdd-bootstrap.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tdd-bootstrap.php b/tdd-bootstrap.php index 9d7998d..2ed216b 100644 --- a/tdd-bootstrap.php +++ b/tdd-bootstrap.php @@ -65,6 +65,15 @@ class Protocol { $dom->find('/html/body/table/tr', 0)->outertext = ''; } + // replacing meta http-equiv refresh with a javascript refresh to preserve hash in the result page + $meta = $head->find('meta'); + foreach ($meta as $metaTag) { + if ($metaTag->hasAttribute('http-equiv') && strtolower($metaTag->getAttribute('http-equiv')) == 'refresh') { + $head->innertext = str_replace($metaTag->outertext, '', $head->innertext) . ''; + break; + } + } + print $dom->outertext; } -- cgit v1.2.3