magento2.3 – How to add firebase cdn’s in magento2?

I am trying to add add web push notification using firebase in my magento2 app. I tested it on a simple web application using following code.

<title>Firebase Messaging Demo</title>
    div {
        margin-bottom: 15px;
<!--     <form method="post" action="send.php">
    <input type="submit" name="submit">
</form> -->
    <div id="msg"></div>
    <div id="token" ></div>
    <div id="notis"></div>
    <div id="err"></div>
    <script src=""></script>
    <script src=""></script>
        MsgElem = document.getElementById("msg");
        TokenElem = document.getElementById("token");
        NotisElem = document.getElementById("notis");
        ErrElem = document.getElementById("err");
        // Initialize Firebase
        // TODO: Replace with your project's customized code snippet
        var config = {
    "apiKey": "xyz",
    "authDomain": "xyz",
    "projectId": "xyz",
    "storageBucket": "xyz",
    "messagingSenderId": "xyz",
    "appId": "xyz",
    "measurementId": "xyz"


        const messaging = firebase.messaging();
            .then(function () {
                MsgElem.innerHTML = "Notification permission granted." 
                console.log("Notification permission granted.");
                // get the token in the form of promise

                return messaging.getToken()
            .then(function(token) {
                TokenElem.innerHTML =token
            .catch(function (err) {
                ErrElem.innerHTML =  ErrElem.innerHTML + "; " + err
                console.log("Unable to get permission to notify.", err);

        let enableForegroundNotification = true;
        messaging.onMessage(function(payload) {
            console.log("Message received. ", payload);
            NotisElem.innerHTML = NotisElem.innerHTML + JSON.stringify(payload);

            if(enableForegroundNotification) {
                const {title, ...options} = JSON.parse(;
                navigator.serviceWorker.getRegistrations().then(registration => {
                    registration(0).showNotification(title, options);



Then I am able to send web push notification using curl command.But when I try to to do the same in magento2 it gives errors and does not let JS cdn’s to be added in my module.I am doing this using require-js.My requirejs-config.js file looks like this.

var config = {
    paths: {
        "*": {
            "firebaseapp": "",
            "firebasemessaging": ""
    shim: {
        'firebaseapp': {
            deps: ('jquery')
        'firebasemessaging': {
            deps: ('jquery')

And .phtml file looks like this.


<label><?= __("Data  from Block is ") ?></label>
<h1><?= $block->getText() ?></h1>
<div id="test"></div>

), function ($,firebaseapp,firebasemessaging) {



But it gives following error.
The resource from “http://localhost/magento235/pub/static/version1610370022/frontend/Vendor1/Customtheme/en_US/firebasemessaging.js” was blocked due to MIME type (“text/plain”) mismatch (X-Content-Type-Options: nosniff).