0

Website works completely fine, until you inspect element and put it in mobile mode:

enter image description here

Then this error pops up:

enter image description here

here is a snip it of my code:

<script async src="https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1" defer></script>
<script type="text/javascript">
         "use strict";
var Context;
    window['__onGCastApiAvailable'] = function (isAvailable) {
        if (isAvailable) {
              Context = cast.framework.CastContext.getInstance();

                Context.setOptions({ receiverApplicationId: "<HASH>", androidReceiverCompatible: true, autoJoinPolicy: "ORIGIN_SCOPED"});

                Context.start;
     }
  }
</script>

website is using a SSL cert

Frank_Vr
  • 661
  • 7
  • 23
  • 1) are you developing a website or a chrome extension? 2) is 'invalid/' your intended path? does that path exist? 3. Are you sure that error emitted from your shown code snippet? – irous Sep 03 '22 at 03:28
  • 1) a website 2) the invalid path comes from the google cast_sender.js (in the snip it) 3. yes the error comes from cast_sender.js – Frank_Vr Sep 03 '22 at 04:10
  • the error occurs on this line: "(document.head || document.documentElement).appendChild(c)" in the cast_sender.js – Frank_Vr Sep 03 '22 at 04:22
  • I think this is relevant: https://stackoverflow.com/questions/55425009/why-am-i-getting-this-error-chrome-extension-invalid – irous Sep 03 '22 at 10:09
  • Thanks, seen that but didn't solve this issue – Frank_Vr Sep 03 '22 at 12:41

1 Answers1

0

This took me way to long to work out, but here it is:

enter image description here

If you select an apple product it comes up with the error, but not with the android devices.

Frank_Vr
  • 661
  • 7
  • 23