1

I have a website that uses embedded videos (via youtube's share -> embed) and when I open DevTools in Chrome, I see an error that says:

Unrecognized feature: 'web-share'.

(anonymous)@react-dom.production….js?ver=16.14.0:184

when I click on the react-dom.production.... link, I see the following code:

  var si = /^(.*)[\\\/]/, Q = "function" === typeof Symbol && Symbol.for, Pc = Q ? Symbol.for("react.element") : 60103, gb = Q ? Symbol.for("react.portal") : 60106, Ma = Q ? Symbol.for("react.fragment") : 60107, Af = Q ? Symbol.for("react.strict_mode") : 60108, kc = Q ? Symbol.for("react.profiler") : 60114, Cf = Q ? Symbol.for("react.provider") : 60109, Bf = Q ? Symbol.for("react.context") : 60110, Hj = Q ? Symbol.for("react.concurrent_mode") : 60111, zd = Q ? Symbol.for("react.forward_ref") : 60112, lc = Q ? Symbol.for("react.suspense") : 60113, yd = Q ? Symbol.for("react.suspense_list") : 60120, Ad = Q ? Symbol.for("react.memo") : 60115, Ef = Q ? Symbol.for("react.lazy") : 60116, Df = Q ? Symbol.for("react.block") : 60121, zf = "function" === typeof Symbol && Symbol.iterator, od, xh = function(a) {
        return "undefined" !== typeof MSApp && MSApp.execUnsafeLocalFunction ? function(b, c, d, e) {
            MSApp.execUnsafeLocalFunction(function() {
                return a(b, c, d, e)
            })
        }
        : a
    }(function(a, b) {
        if ("http://www.w3.org/2000/svg" !== a.namespaceURI || "innerHTML"in a)
            a.innerHTML = b;
        else {
            od = od || document.createElement("div");
            od.innerHTML = "<svg>" + b.valueOf().toString() + "</svg>";
            for (b = od.firstChild; a.firstChild; )
                a.removeChild(a.firstChild);
            for (; b.firstChild; )
                a.appendChild(b.firstChild)
        }
    }), 

I have no idea what to make of this (supposedly, this is all code belonging to 184) as I'm new to JavaScript and React.

Can I fix this error on my website? If so, how? Or is this a Youtube issue?

I've tried looking everywhere online, but I'm not finding any references to my specific error. I thought about removing web-share from the iframe embed code, but it's a lot of videos to go through lol.

Example of the iframe embed code:

<iframe width="241" height="143" src="https://www.youtube-nocookie.com/embed/youtubeid" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen=""></iframe>

1 Answer 1

4

This isn't a problem with your website and doesn't seem to have negative effects. It's a bug in Chrome desktop, which doesn't support Web Share.

This feature was required as of Chrome 110 to be added to the allow property of iframes if the iframe wants to use the Web Share API. YouTube specifies it in their embed code. But Chrome on desktop doesn't recognize it.

Chrome has a test site for the new behavior, linked from their own feature tracker which also shows the warning.

You could try to only include the web-share bit if navigator.canShare exists. That would remove the warning. But it's harmless anyway. Something like:

const myIframe = ...;
const hasWebShare = 'canShare' in navigator;
if (hasWebShare) {
    myIframe.allow = 'web-share';
}

But generally not worth it.

1
  • Ah, got it. Thank you!
    – catdog7220
    Commented Sep 20, 2023 at 22:52

Not the answer you're looking for? Browse other questions tagged or ask your own question.