firefoxweb-share

navigator.share is set on desktop Firefox but doesn't do anything


I have some code like this:

if (navigator.share) {
  navigator.share({
    title: 'example',
    url: 'http://example.com',
  });
}

According to this documentation for navigator.share on MDN, desktop browsers do not support the Web Share API, and navigator.share is undefined in those browsers.

However, when I run this code in desktop Firefox, navigator.share is defined and set to a function that doesn't seem to do anything when called.


Solution

  • It probably is a browser extension that is setting navigator.share. Try disabling all your extensions.

    In my case, it turned out to be this extension: Plasma Integration by KDE.