safari-mcp 2.7.12 → 2.7.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/safari.js +6 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "safari-mcp",
3
- "version": "2.7.12",
3
+ "version": "2.7.13",
4
4
  "mcpName": "io.github.achiya-automation/safari-mcp",
5
5
  "description": "Safari browser automation for AI agents — native macOS, zero Chrome overhead. 80 tools via AppleScript + JavaScript.",
6
6
  "type": "module",
package/safari.js CHANGED
@@ -1560,7 +1560,12 @@ export async function pressKey({ key, modifiers = [] }) {
1560
1560
  if (!prevented) {
1561
1561
  if ('${safeKey}' === 'Enter') {
1562
1562
  if (el.tagName === 'INPUT') { el.form && el.form.dispatchEvent(new Event('submit',{bubbles:true})); }
1563
- else { document.execCommand('insertLineBreak'); }
1563
+ else if (el.tagName === 'TEXTAREA') { document.execCommand('insertLineBreak'); }
1564
+ else if (el.isContentEditable && ${shiftKey}) { document.execCommand('insertLineBreak'); }
1565
+ // ContentEditable + Enter (no Shift): do NOT insertLineBreak.
1566
+ // Modern editors (Discord Slate, Slack, Notion, Medium) handle Enter
1567
+ // in their own keydown listener to trigger submit/send/newBlock.
1568
+ // insertLineBreak would double-act: the app submits AND we add a newline.
1564
1569
  } else if ('${safeKey}' === 'Tab') {
1565
1570
  var focusable = [...document.querySelectorAll('input,textarea,select,button,a,[tabindex]')].filter(function(e){return e.tabIndex>=0;});
1566
1571
  var idx = focusable.indexOf(el);