Jump to content

Recommended Posts

Posted

Hey @adrian I have this hook in place:

$wire->addHookAfter("/foo", function () {
  return "foo";
});

And the page shows "foo" as expected. But it also shows the debug bar and I did not find an easy solution for disabling it... Is there (or could there be ? ) something like this:

$wire->addHookAfter("/foo", function () {
  $this->wire->tracy->noBar = true;
  return "foo";
});

 

Posted

Hey @bernhard,
the "disable tracy" button in the debug bar is invoking a js method "disableTracy()" which does this:

function disableTracy() {
      document.cookie = "tracyDisabled=1; expires=0; path=/";
      location.reload();
}            

Maybe you can then, in your hook url, use the WireHttp:setCookie() method and do the same as above?

Let me know :)

Posted

Hey @bernhard - any particular reason you want it disabled?

That said, you can do what you want very easily by adding this in your URL hook.

\Tracy\Debugger::$showBar = false;
  • Thanks 1
Posted

Thx, that works!

I'm working on my pagebuilder and have a mobile preview where the debug bar is a little disturbing I guess. But I might hide it via CSS so that it is still visible on desktop view, I'm not sure:

eMNYtGk.png

Good to know how to disable the debug bar though - thx!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...