feat: add context menu disable feature

This commit is contained in:
iamsivin
2026-04-21 18:23:05 +05:30
parent 6ff0c67501
commit 475ca365c0
3 changed files with 20 additions and 0 deletions
@@ -373,6 +373,8 @@ const componentToRender = computed(() => {
});
const shouldShowContextMenu = computed(() => {
// eslint-disable-next-line no-underscore-dangle
if (window.__WOOT_DISABLE_CONTEXT_MENU__) return false;
return !props.contentAttributes?.isUnsupported;
});
@@ -439,6 +441,12 @@ const shouldRenderMessage = computed(() => {
});
function openContextMenu(e) {
// eslint-disable-next-line no-underscore-dangle
if (window.__WOOT_DISABLE_CONTEXT_MENU__) {
e.preventDefault();
return;
}
const shouldSkipContextMenu =
e.target?.classList.contains('skip-context-menu') ||
['a', 'img'].includes(e.target?.tagName.toLowerCase());