No description
Find a file
Michael Naumov 7553a295b6 Update lib
2025-04-04 23:56:19 -06:00
.github Template 2025-03-20 13:51:51 -06:00
images Add diff images 2025-03-25 17:08:14 -06:00
src New template 2025-04-04 22:28:38 -06:00
.editorconfig Template 2025-03-20 13:51:51 -06:00
.gitattributes Template 2025-03-20 13:51:51 -06:00
.gitignore Template 2025-03-20 13:51:51 -06:00
.npmrc Template 2025-03-20 13:51:51 -06:00
CHANGELOG.md 1.5.0 2025-03-30 21:22:01 -06:00
cspell.json Switch to new template 2025-04-04 17:30:14 -06:00
eslint.config.mts Template 2025-03-20 13:51:51 -06:00
LICENSE Template 2025-03-20 13:51:51 -06:00
manifest.json 1.5.0 2025-03-30 21:22:01 -06:00
package-lock.json Update lib 2025-04-04 23:56:19 -06:00
package.json Update lib 2025-04-04 23:56:19 -06:00
README.md Update README 2025-03-30 10:45:23 -06:00
tsconfig.json Template 2025-03-20 13:51:51 -06:00
versions.json 1.5.0 2025-03-30 21:22:01 -06:00

Advanced Debug Mode

This is a plugin for Obsidian that enhances Obsidian debug mode.

Features

Obsidian Debug mode

The plugin adds an easy way to switch Obsidian debug mode on/off. When active, inline source maps will not be stripped from loaded plugins.

Long stack traces

Error stack traces are usually very limited and stack frames for function like setTimeout or addEventListener are usually not included, so sometimes it's difficult to find the root cause of the error.

The plugin tries to preserve long stack traces as much as possible.

Long stack traces

function foo() {
  bar();
}

function bar() {
  setTimeout(baz, 100);
}

function baz() {
  qux();
}

function qux() {
  throw new Error('Error from qux');
}

foo();

Without the plugin you get the error in the console

Uncaught Error: Error from qux
    at qux (<anonymous>:14:9)
    at baz (<anonymous>:10:3)

With the plugin you get

Uncaught Error: Error from qux
    at qux (<anonymous>:14:9)
    at baz (<anonymous>:10:3)
    at --- setTimeout --- (0)
    at bar (<anonymous>:6:3)
    at foo (<anonymous>:2:3)
    at <anonymous>:1:1

Async long stack traces

Async long stack traces are the traces for async functions.

async function foo() {
  await bar();
}

Warning

The plugin adds async long stack traces only on desktop. Adding it to mobile is impossible due to the current JavaScript Engine limitations.

Async long stack traces might contain some duplicates.

When async long stack traces are enabled, the autocompletion in DevTools console stops working. It seems to be a bug in Electron.

Async long stack traces

function foo1() {
  foo2();
}

function foo2() {
  setTimeout(foo3, 100);
}

function foo3() {
  // calling async from sync
  barAsync1();
}

async function barAsync1() {
  await sleep(100);
  await barAsync2();
}

async function barAsync2() {
  await sleep(100);
  await barAsync3();
}

async function barAsync3() {
  await sleep(100);
  // calling sync from async
  foo4();
}

function foo4() {
  foo5();
}

function foo5() {
  throw new Error('Error from foo5');
}

foo1();

Without the plugin you get the error in the console

Uncaught (in promise) Error: Error from foo5
    at foo5 (<anonymous>:35:9)
    at foo4 (<anonymous>:31:3)
    at barAsync3 (<anonymous>:27:3)
    at async barAsync2 (<anonymous>:21:3)
    at async barAsync1 (<anonymous>:16:3)

With the plugin you get

Uncaught (in promise) Error: Error from foo5
    at foo5 (<anonymous>:35:9)
    at foo4 (<anonymous>:31:3)
    at barAsync3 (<anonymous>:27:3)
    at async barAsync2 (<anonymous>:21:3)
    at async barAsync1 (<anonymous>:16:3)
    at --- async --- (0)
    at barAsync3 (<anonymous>:25:9)
    at barAsync2 (<anonymous>:21:9)
    at async barAsync1 (<anonymous>:16:3)
    at --- async --- (0)
    at barAsync2 (<anonymous>:20:9)
    at barAsync1 (<anonymous>:16:9)
    at --- async --- (0)
    at barAsync1 (<anonymous>:15:9)
    at foo3 (<anonymous>:11:3)
    at --- setTimeout --- (0)
    at foo2 (<anonymous>:6:3)
    at foo1 (<anonymous>:2:3)
    at <anonymous>:38:1

DevTools for mobile app

The plugin adds DevTools for the mobile app. This helps to debug the plugins without connecting mobile to the desktop.

DevTools

Debug namespaces management

Some plugins use debug library to conditionally show/hide console.debug messages.

The plugin adds an ability to manage those debug namespaces from the UI.

For more details, refer to the documentation.

Timeout long running tasks

There are some default timeouts for long running tasks. Sometimes those timeouts are being hit while you are debugging some code and staying on the breakpoint for too long.

The plugin allows to temporarily disable those timeouts to keep debugging.

Installation

The plugin is not available in the official Community Plugins repository yet.

Beta versions

To install the latest beta release of this plugin (regardless if it is available in the official Community Plugins repository or not), follow these steps:

  1. Ensure you have the BRAT plugin installed and enabled.
  2. Click Install via BRAT.
  3. An Obsidian pop-up window should appear. In the window, click the Add plugin button once and wait a few seconds for the plugin to install.

Support

Buy Me A Coffee

License

© Michael Naumov