Vector35 / snippets

plugin for storing and using snippets of useful Binja script
MIT License
22 stars 7 forks source link

snippets should not be loaded in headless mode #31

Open xusheng6 opened 2 years ago

xusheng6 commented 2 years ago

Currently, I observe that the snippets plugin is also loaded in headless mode. I observed this when I try to run the BN unit tests. While this is related to https://github.com/Vector35/binaryninja-api/issues/1556, but it is different. Python plugins are too flexible and BN have no way of differentiating core/UI plugins, so the plugin itself should detect whether it is running in headless mode and decide whether it should load. binaryninja.core_ui_enabled() should fit the purpose.

psifertex commented 2 years ago

Snippets can be triggered via the action system so maybe having them load in headless is worth keeping? Not sure. I'm not against disabling it though.

That said, unit tests should always be run with BNDISABLE PLUGINS set anyway fwiw.