Unable to Use External Script in index.html

Whenever I put an external script inside my index.html I get the error Refused to load the script 'https://www.youtube.com/iframe_api' because it violates the following Content Security Policy directive: "script-src 'self'. Apparently I need to change my tag but every time I follow some solution online, electron randomly tries to access my webcam!! My current tag is: <meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' http://* 'unsafe-inline'; script-src 'self' http://* 'unsafe-inline' 'unsafe-eval'" />, which works but tries to access my webcam. I’m incredibly confused, any help would be greatly appreciated.

This “external script” sounds very dodgy to me. Klaxons should be loud if the script is trying unauthorised random access to your webcam. Get rid of it in my view.

However if you are expecting such requests to be authorised by you then research Chrome settings guide here.

It’s the youtube iframe api. There shouldn’t be a problem. Lol this is only because I updated from one of the earliest versions of electron to the latest version, so it was working before and there were no webcam problems. Wdym “get rid of it in my view”?

All I want is to have an external script from youtube in my index.html. The whole webcam thing is completely unwanted and random.