obsproject / obs-browser

CEF-based OBS Studio browser plugin
GNU General Public License v2.0
781 stars 222 forks source link

Add ability to directly open Dev Tools for Panels #381

Closed WizardCM closed 1 year ago

WizardCM commented 1 year ago

Description

This adds "Inspect" to the context menu of browser panels, allowing for easier testing, debugging & troubleshooting for developers.

image

image

Edit: This now provides a more useful window title

image

Motivation and Context

It's incredibly common to access Chrome Dev Tools to troubleshoot a webpage. While users can launch OBS with --remote-debugging-port to provide a way to access Dev Tools externally, if an issue crops up on a run where the flag wasn't used, it can be impossible to debug.

How Has This Been Tested?

On Windows, right click on a Browser Panel. Select Inspect See that the inspector is focused on the element that was right clicked

Types of changes

Checklist:

WizardCM commented 1 year ago

Code is ready for review & testing on all platforms. I'll fix formatting in the second commit shortly.

Gol-D-Ace commented 1 year ago

This is btw. no longer compatible with older CEF versions (aka legacy build option) because of bounds.

Perhaps should put a ifdef there or remove the legacy build option.

WizardCM commented 1 year ago

Ah, yes probably time to remove the legacy build option, I agree.