登录表单被 CSP 阻止,我不明白为什么
Chrome 版本 94.0.4606.61
错误信息 :
拒绝将表单数据发送到“https://subdomain.mydomain.com/login/local”,因为它违反了以下内容安全策略指令:“form-action 'self' https: *.mydomain.com”。
火狐浏览器没问题
在 Google Chrome 扩展程序中,我知道如何在选定文本上显示上下文菜单。
chrome.contextMenus.create({
'title': 'TEST',
'contexts': ['selection'],
'id': "test"
});
chrome.contextMenus.create({
'title': 'submenu',
'contexts': ['selection'],
'id': "test_1",
'parentId': "test",
'onclick': menu.onClicked_
});
Run Code Online (Sandbox Code Playgroud)

但我只想在所选文本位于“可编辑元素”(输入文本、文本区域、内容可编辑 DIV 等)中时才显示此菜单。我怎样才能做到这一点 ?
谢谢!
javascript google-chrome contextmenu google-chrome-extension