JavaScript Element webkitmouseforcewillbegin Event

Beginner
⏱️ 11 min read
📚 Updated: Jul 2026
🎯 5 Examples
🚀 5 Try-it labs
Non-standard
Instance event

What You’ll Learn

The webkitmouseforcewillbegin event fires before the initial mousedown in Safari for macOS. Learn why preventDefault() matters, how it fits the Force Touch family, onwebkitmouseforcewillbegin, portable alternatives, and five try-it labs.

01

Kind

Instance event

02

Type

MouseEvent

03

When

Before mousedown

04

Handler

onwebkitmouseforcewillbegin

05

Key API

preventDefault()

06

Status

Non-standard

Introduction

On Safari for macOS with Force Touch, the earliest Force Touch-related signal is often webkitmouseforcewillbegin—it fires before mousedown. That early timing lets your page opt out of macOS default Force Touch behaviors (lookup, peek, and similar system actions) if the press becomes a force click.

MDN: call preventDefault() on this event to tell the system not to engage those defaults. Then handle force yourself with webkitmouseforcedown, webkitmouseforcechanged, and webkitmouseforceup.

💡
Beginner tip

If you only need a custom force-click UI and do not want Safari’s system Force Touch UI, listen for webkitmouseforcewillbegin and call preventDefault() there—before mousedown arrives.

Understanding webkitmouseforcewillbegin

An instance event that answers: “A Force Touch-capable press is about to start—do you want to keep system Force Touch defaults?”

  • Timing — before the initial mousedown (Safari macOS).
  • Main jobpreventDefault() to suppress default Force Touch actions.
  • MouseEvent — includes non-standard webkitForce.
  • Non-standard — Safari / WebKit proprietary; not Baseline.

📝 Syntax

Use the event name with addEventListener, or set the handler property:

JavaScript
addEventListener("webkitmouseforcewillbegin", (event) => { });

onwebkitmouseforcewillbegin = (event) => { };

Event type

A MouseEvent (inherits from UIEvent / Event).

Handy notes

NameMeaning
event.preventDefault()Ask macOS not to run default Force Touch actions later
event.webkitForceCurrent pressure amount (non-standard)
MouseEvent.WEBKIT_FORCE_AT_FORCE_MOUSE_DOWNMinimum force for a force click (later events)
clientX / clientYPointer position in the viewport

⚡ Quick Reference

GoalCode
Listenel.addEventListener("webkitmouseforcewillbegin", fn)
Handler propertyel.onwebkitmouseforcewillbegin = fn
Block system Force Touch UIevent.preventDefault()
Orderwillbegin → mousedown → …
Portable presspointerdown
MDN statusNon-standard

🔍 At a Glance

Four facts to remember about webkitmouseforcewillbegin.

Event type
MouseEvent

Before down

Means
will begin

Pre-mousedown

Special
preventDefault

Block system FT

Standard?
no

Non-standard

Examples Gallery

Examples follow MDN Element: webkitmouseforcewillbegin event and Apple’s Force Touch docs. Labs feature-detect so they still teach useful lessons without Force Touch hardware.

📚 Getting Started

Register handlers the MDN ways before mousedown.

Example 1 — addEventListener("webkitmouseforcewillbegin")

Log the early Force Touch signal (Safari macOS).

JavaScript
const pad = document.getElementById("pad");
const out = document.getElementById("out");

pad.addEventListener("webkitmouseforcewillbegin", () => {
  out.textContent = "webkitmouseforcewillbegin (before mousedown)";
});

pad.addEventListener("mousedown", () => {
  out.textContent += " → mousedown";
});
Try It Yourself

How It Works

On supporting Safari, willbegin appears first. Elsewhere you may only see mousedown (or nothing for the Force Touch event).

Example 2 — onwebkitmouseforcewillbegin Property

MDN’s alternate style using the event handler property.

JavaScript
const pad = document.getElementById("pad");
const out = document.getElementById("out");

pad.onwebkitmouseforcewillbegin = () => {
  out.textContent = "onwebkitmouseforcewillbegin fired";
};
Try It Yourself

How It Works

Prefer addEventListener when you need multiple listeners or easy removal.

📈 Detect, preventDefault & Order

Feature-detect, suppress system Force Touch defaults, log the full early sequence.

Example 3 — Feature-Detect Force Touch Events

Tell learners whether this engine looks Force Touch capable.

JavaScript
const out = document.getElementById("out");
const supported =
  "onwebkitmouseforcewillbegin" in window ||
  "onwebkitmouseforcewillbegin" in document.documentElement;

out.textContent = supported
  ? "Force Touch event properties look available (likely Safari)."
  : "No webkitmouseforcewillbegin here — use pointerdown instead.";

if (supported) {
  document.getElementById("pad").addEventListener(
    "webkitmouseforcewillbegin",
    () => {
      out.textContent = "willbegin detected";
    }
  );
}
Try It Yourself

How It Works

Property presence is a hint, not a guarantee of Force Touch hardware. Treat a positive result as an optional enhancement path.

Example 4 — preventDefault() to Block System Force Touch

MDN’s key use: opt out of macOS default Force Touch actions.

JavaScript
const pad = document.getElementById("pad");
const out = document.getElementById("out");

pad.addEventListener("webkitmouseforcewillbegin", (event) => {
  event.preventDefault(); // no system Force Touch defaults
  out.textContent = "preventDefault() on willbegin — custom Force Touch UI only";
});

pad.addEventListener("webkitmouseforcedown", () => {
  out.textContent = "Custom force-click (system defaults suppressed)";
});
Try It Yourself

How It Works

Calling preventDefault() early tells macOS not to run its own Force Touch UI if pressure later reaches a force click—so your page can own the interaction.

Example 5 — Event Order + Pointer Fallback

Log willbegin → mousedown when available; otherwise use pointerdown.

JavaScript
const pad = document.getElementById("pad");
const out = document.getElementById("out");
const steps = [];

function log(step) {
  steps.push(step);
  out.textContent = steps.join(" → ");
}

const forceOk = "onwebkitmouseforcewillbegin" in window;

if (forceOk) {
  pad.addEventListener("webkitmouseforcewillbegin", (e) => {
    e.preventDefault();
    log("willbegin");
  });
  pad.addEventListener("mousedown", () => log("mousedown"));
  pad.addEventListener("webkitmouseforcedown", () => log("forcedown"));
} else {
  pad.addEventListener("pointerdown", () => {
    log("pointerdown (fallback)");
  });
}
Try It Yourself

How It Works

On Safari Force Touch you should see willbegin before mousedown. Elsewhere, fall back to Pointer Events for a portable press start.

🚀 Common Use Cases

  • Disabling macOS system Force Touch peek/lookup on custom interactive widgets.
  • Owning force-click UI entirely in your web app (after preventDefault).
  • Teaching the Force Touch timeline that starts before mousedown.
  • Preparing state early before pressure stream / force-click events arrive.
  • Migrating legacy Safari Force Touch demos with correct default suppression.

🔧 How It Works

1

Press begins (Force Touch capable)

Safari can fire webkitmouseforcewillbegin first.

Early
2

Optional preventDefault()

Tell macOS not to run default Force Touch actions later.

Opt out
3

mousedown and Force Touch stream

Then changed / forcedown / forceup as pressure changes.

Press
4

Your custom Force Touch UI runs

Without competing system Force Touch chrome (when prevented).

📝 Notes

Non-standard / Safari Force Touch Support

webkitmouseforcewillbegin is marked Non-standard on MDN. Logos use the shared browser-image-sprite.png sprite from this project. Expect Safari on macOS Force Touch hardware only—always ship a Pointer Events press path.

Non-standard

Element webkitmouseforcewillbegin

Proprietary WebKit Force Touch pre-mousedown signal; use preventDefault() to suppress system Force Touch defaults.

Safari Not standardized
Google Chrome No Force Touch events; use pointerdown
No
Mozilla Firefox No Force Touch events; use pointerdown
No
Apple Safari macOS Force Touch (before mousedown)
WebKit
Microsoft Edge No Force Touch events; use pointerdown
No
Opera No Force Touch events; use pointerdown
No
Internet Explorer No
No
webkitmouseforcewillbegin Non-standard

Bottom line: Use willbegin only as an optional Safari enhancement (especially preventDefault). Prefer pointerdown for portable press start.

Conclusion

webkitmouseforcewillbegin is Safari’s earliest Force Touch hook—before mousedown—mainly so you can preventDefault() system Force Touch actions and own the interaction yourself.

Continue with wheel, webkitmouseforcedown, or the JavaScript hub.

💡 Best Practices

✅ Do

  • Feature-detect before attaching Force Touch listeners
  • Call preventDefault() when you own force-click UI
  • Still handle forcedown / forceup for custom behavior
  • Keep Force Touch as an optional Safari enhancement
  • Test on real Force Touch Mac hardware when shipping Safari extras

❌ Don’t

  • Require webkitmouseforcewillbegin for core product features
  • Assume Chromium/Firefox will ever fire these events
  • Forget that this fires before mousedown
  • Suppress system defaults unless you replace them with your own UX
  • Skip a portable pointerdown path for other browsers

Key Takeaways

Knowledge Unlocked

Five things to remember about webkitmouseforcewillbegin

Before mousedown—opt out of system Force Touch if you need to.

5
Core concepts
🚫 02

preventDefault

block system FT

API
🖱 03

MouseEvent

webkitForce

Type
📱 04

Prefer

pointerdown

Portable
🚫 05

Non-standard

Safari only

Status

❓ Frequently Asked Questions

Safari for macOS fires webkitmouseforcewillbegin on an element before the initial mousedown. Its main use is calling preventDefault() so the system does not run default Force Touch actions if the press becomes a force click.
MDN marks Element webkitmouseforcewillbegin as Non-standard only — not Deprecated and not Experimental. It is not part of any web specification. Prefer portable APIs for production.
A MouseEvent (inherits from UIEvent / Event). It also exposes the non-standard MouseEvent.webkitForce property.
Use element.addEventListener("webkitmouseforcewillbegin", handler), or set onwebkitmouseforcewillbegin where supported. Always feature-detect first.
MDN: calling preventDefault() on webkitmouseforcewillbegin tells macOS not to engage default Force Touch actions if the user applies enough pressure for a Force Touch event — useful when your page handles force clicks itself.
It fires before the initial mousedown. Then you may see webkitmouseforcechanged, webkitmouseforcedown, webkitmouseforceup, and finally mouseup.
Did you know?

Among Apple’s Force Touch events, webkitmouseforcewillbegin is the one designed to be default-preventable so web pages can take over Force Touch instead of competing with macOS lookup/peek UI.

Next: wheel

Learn mouse wheel / trackpad WheelEvent handling.

wheel →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

5 people found this page helpful