Closed heldchen closed 7 years ago
turns out its pretty simple to achieve, please see the following patch:
diff --git a/www/vendor/mirasvit/module-profiler/src/Profiler/Block/Container.php b/www/vendor/mirasvit/module-profiler/src/Profiler/Block/Container.php
index 505e983..b2a59a7 100644
--- a/www/vendor/mirasvit/module-profiler/src/Profiler/Block/Container.php
+++ b/www/vendor/mirasvit/module-profiler/src/Profiler/Block/Container.php
@@ -63,4 +63,20 @@ class Container extends Template
{
return $this->context->getDbProfiler()->getTotalElapsedSecs();
}
+
+ /**
+ * @return string
+ */
+ protected function _toHtml()
+ {
+ foreach (headers_list() as $header)
+ {
+ if (stripos($header, 'Content-type') !== FALSE) {
+ if ((strpos($header, 'json') !== FALSE) || (strpos($header, 'xml') !== FALSE))
+ return '';
+ }
+ }
+
+ return parent::_toHtml();
+ }
}
has this been fixed in the code? haven't seen a commit related to this, maybe missed it tho...
some extension (Magme WebForms Pro 2) use an iframe to post form data and get json back. unfortunately, Mirasvit_Profiler then appends its profiling block to the result, breaking the javascript execution.
could the extension check if a response header with content-type "application/json" is set and then not output the block?