Cross-Origin Read Blocking (CORB) error with Firebase StorageWhy doesn't adding CORS headers to an OPTIONS route allow browsers to access my API?AngularJS performs an OPTIONS HTTP request for a cross-origin resourceWhy does my JavaScript code get a “No 'Access-Control-Allow-Origin' header is present on the requested resource” error when Postman does not?Firefox 'Cross-Origin Request Blocked' despite headersFont from origin has been blocked from loading by Cross-Origin Resource Sharing policyFirebase Storage and Access-Control-Allow-OriginFirebase web: Storage Location from Download URLThird party Javascript blocked (CORB)Write to Firebase Storage with JavaScript gives “Cross-Origin Request Blocked”Download firebase storage file to computer

Aligning arrays within arrays within another array

2019 2-letters 33-length list

How do you introduce yourself on the phone in a formal setting?

Why can't i use !(single pattern) in zsh even after i turn on kshglob?

SQL Server Ignoring Instance name when using port number of different instance

Why will we fail creating a self sustaining off world colony?

Why is quantum gravity non-renormalizable?

Using quotation marks and exclamation marks

Variable declaration inside main loop

Emphasize numbers in tables

Other homotopy invariants?

What's the difference between the Find Steed and Find Greater Steed spells?

How can I change my buffer system for protein purification?

Why are examinees often not allowed to leave during the start and end of an exam?

Odd PCB Layout for Voltage Regulator

How do I tell my girlfriend she's been buying me books by the wrong author for the last nine months?

Is there a connection between representation theory and PDEs?

Avoiding repetition when using the "snprintf idiom" to write text

I agreed to cancel a long-planned vacation (with travel costs) due to project deadlines, but now the timeline has all changed again

usage of y" not just for locations?

Why doesn't SpaceX land boosters in Africa?

Could citing a database like libgen get one into trouble?

What verb goes with "coup"?

How useful would a hydroelectric power plant be in the post-apocalypse world?



Cross-Origin Read Blocking (CORB) error with Firebase Storage


Why doesn't adding CORS headers to an OPTIONS route allow browsers to access my API?AngularJS performs an OPTIONS HTTP request for a cross-origin resourceWhy does my JavaScript code get a “No 'Access-Control-Allow-Origin' header is present on the requested resource” error when Postman does not?Firefox 'Cross-Origin Request Blocked' despite headersFont from origin has been blocked from loading by Cross-Origin Resource Sharing policyFirebase Storage and Access-Control-Allow-OriginFirebase web: Storage Location from Download URLThird party Javascript blocked (CORB)Write to Firebase Storage with JavaScript gives “Cross-Origin Request Blocked”Download firebase storage file to computer













1















I'm using a download URL to get an HTML file from my Firebase Storage and display it in a template. In my template I'm using <img> with the src set to the download URL. The browser shows a broken file and the console says



Cross-Origin Read Blocking (CORB) blocked cross-origin response https://firebasestorage.googleapis.com/v0/b/languagetwo-cd94d.appspot.com/o/English_Videos%2FWalker_Climbs_a_Tree%2Fscript.html?alt=media&token=8772258d-9417-4f93-b16d-29d353c5262


and then the download URL. The download URL works when I put it in a browser window. As the documentation suggested I made this file



[

"origin": "*",
"method": "GET",
"maxAgeSeconds": 3600

]


named it cors.json, and ran



gsutil cors set cors.json gs://languagetwo-cd94d.appspot.com



I updated gsutil. I cleared my Chrome cache. I tried my app in Chromium. I tried POST instead of GET. I'm still getting the CORB error. What else should I try? Do I need to set Content-Type?










share|improve this question



















  • 1





    “I'm using a download URL to get an HTML file from my Firebase Storage and display it in a template. In my template I'm using <img> with the src set to the download URL.” — Given that, it sounds like the browser is blocking your frontend code from accessing the response because you’re trying to use a text/html response in a context where the browser instead expects an image. Regardless, based on the error message cited in the question, you have a CORB problem, not a CORS problem. So your CORS configuration isn’t going to have any effect either way on this.

    – sideshowbarker
    Mar 25 at 17:21












  • Thanks stackoverflow.com/users/441757/sideshowbarker, when I get rid of the <img> tag the CORB error message goes away. Now my page displays the download URL. How do I convert the download URL into the HTML file?

    – Thomas David Kehoe
    Mar 25 at 17:37











  • I'm using $http.get(downloadURL). It's almost working, my template is displaying the file, but the HTML tags are showing as well...

    – Thomas David Kehoe
    Mar 25 at 17:45















1















I'm using a download URL to get an HTML file from my Firebase Storage and display it in a template. In my template I'm using <img> with the src set to the download URL. The browser shows a broken file and the console says



Cross-Origin Read Blocking (CORB) blocked cross-origin response https://firebasestorage.googleapis.com/v0/b/languagetwo-cd94d.appspot.com/o/English_Videos%2FWalker_Climbs_a_Tree%2Fscript.html?alt=media&token=8772258d-9417-4f93-b16d-29d353c5262


and then the download URL. The download URL works when I put it in a browser window. As the documentation suggested I made this file



[

"origin": "*",
"method": "GET",
"maxAgeSeconds": 3600

]


named it cors.json, and ran



gsutil cors set cors.json gs://languagetwo-cd94d.appspot.com



I updated gsutil. I cleared my Chrome cache. I tried my app in Chromium. I tried POST instead of GET. I'm still getting the CORB error. What else should I try? Do I need to set Content-Type?










share|improve this question



















  • 1





    “I'm using a download URL to get an HTML file from my Firebase Storage and display it in a template. In my template I'm using <img> with the src set to the download URL.” — Given that, it sounds like the browser is blocking your frontend code from accessing the response because you’re trying to use a text/html response in a context where the browser instead expects an image. Regardless, based on the error message cited in the question, you have a CORB problem, not a CORS problem. So your CORS configuration isn’t going to have any effect either way on this.

    – sideshowbarker
    Mar 25 at 17:21












  • Thanks stackoverflow.com/users/441757/sideshowbarker, when I get rid of the <img> tag the CORB error message goes away. Now my page displays the download URL. How do I convert the download URL into the HTML file?

    – Thomas David Kehoe
    Mar 25 at 17:37











  • I'm using $http.get(downloadURL). It's almost working, my template is displaying the file, but the HTML tags are showing as well...

    – Thomas David Kehoe
    Mar 25 at 17:45













1












1








1


0






I'm using a download URL to get an HTML file from my Firebase Storage and display it in a template. In my template I'm using <img> with the src set to the download URL. The browser shows a broken file and the console says



Cross-Origin Read Blocking (CORB) blocked cross-origin response https://firebasestorage.googleapis.com/v0/b/languagetwo-cd94d.appspot.com/o/English_Videos%2FWalker_Climbs_a_Tree%2Fscript.html?alt=media&token=8772258d-9417-4f93-b16d-29d353c5262


and then the download URL. The download URL works when I put it in a browser window. As the documentation suggested I made this file



[

"origin": "*",
"method": "GET",
"maxAgeSeconds": 3600

]


named it cors.json, and ran



gsutil cors set cors.json gs://languagetwo-cd94d.appspot.com



I updated gsutil. I cleared my Chrome cache. I tried my app in Chromium. I tried POST instead of GET. I'm still getting the CORB error. What else should I try? Do I need to set Content-Type?










share|improve this question
















I'm using a download URL to get an HTML file from my Firebase Storage and display it in a template. In my template I'm using <img> with the src set to the download URL. The browser shows a broken file and the console says



Cross-Origin Read Blocking (CORB) blocked cross-origin response https://firebasestorage.googleapis.com/v0/b/languagetwo-cd94d.appspot.com/o/English_Videos%2FWalker_Climbs_a_Tree%2Fscript.html?alt=media&token=8772258d-9417-4f93-b16d-29d353c5262


and then the download URL. The download URL works when I put it in a browser window. As the documentation suggested I made this file



[

"origin": "*",
"method": "GET",
"maxAgeSeconds": 3600

]


named it cors.json, and ran



gsutil cors set cors.json gs://languagetwo-cd94d.appspot.com



I updated gsutil. I cleared my Chrome cache. I tried my app in Chromium. I tried POST instead of GET. I'm still getting the CORB error. What else should I try? Do I need to set Content-Type?







cors google-cloud-storage firebase-storage






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 25 at 16:57







Thomas David Kehoe

















asked Mar 25 at 15:51









Thomas David KehoeThomas David Kehoe

2,6511 gold badge16 silver badges44 bronze badges




2,6511 gold badge16 silver badges44 bronze badges







  • 1





    “I'm using a download URL to get an HTML file from my Firebase Storage and display it in a template. In my template I'm using <img> with the src set to the download URL.” — Given that, it sounds like the browser is blocking your frontend code from accessing the response because you’re trying to use a text/html response in a context where the browser instead expects an image. Regardless, based on the error message cited in the question, you have a CORB problem, not a CORS problem. So your CORS configuration isn’t going to have any effect either way on this.

    – sideshowbarker
    Mar 25 at 17:21












  • Thanks stackoverflow.com/users/441757/sideshowbarker, when I get rid of the <img> tag the CORB error message goes away. Now my page displays the download URL. How do I convert the download URL into the HTML file?

    – Thomas David Kehoe
    Mar 25 at 17:37











  • I'm using $http.get(downloadURL). It's almost working, my template is displaying the file, but the HTML tags are showing as well...

    – Thomas David Kehoe
    Mar 25 at 17:45












  • 1





    “I'm using a download URL to get an HTML file from my Firebase Storage and display it in a template. In my template I'm using <img> with the src set to the download URL.” — Given that, it sounds like the browser is blocking your frontend code from accessing the response because you’re trying to use a text/html response in a context where the browser instead expects an image. Regardless, based on the error message cited in the question, you have a CORB problem, not a CORS problem. So your CORS configuration isn’t going to have any effect either way on this.

    – sideshowbarker
    Mar 25 at 17:21












  • Thanks stackoverflow.com/users/441757/sideshowbarker, when I get rid of the <img> tag the CORB error message goes away. Now my page displays the download URL. How do I convert the download URL into the HTML file?

    – Thomas David Kehoe
    Mar 25 at 17:37











  • I'm using $http.get(downloadURL). It's almost working, my template is displaying the file, but the HTML tags are showing as well...

    – Thomas David Kehoe
    Mar 25 at 17:45







1




1





“I'm using a download URL to get an HTML file from my Firebase Storage and display it in a template. In my template I'm using <img> with the src set to the download URL.” — Given that, it sounds like the browser is blocking your frontend code from accessing the response because you’re trying to use a text/html response in a context where the browser instead expects an image. Regardless, based on the error message cited in the question, you have a CORB problem, not a CORS problem. So your CORS configuration isn’t going to have any effect either way on this.

– sideshowbarker
Mar 25 at 17:21






“I'm using a download URL to get an HTML file from my Firebase Storage and display it in a template. In my template I'm using <img> with the src set to the download URL.” — Given that, it sounds like the browser is blocking your frontend code from accessing the response because you’re trying to use a text/html response in a context where the browser instead expects an image. Regardless, based on the error message cited in the question, you have a CORB problem, not a CORS problem. So your CORS configuration isn’t going to have any effect either way on this.

– sideshowbarker
Mar 25 at 17:21














Thanks stackoverflow.com/users/441757/sideshowbarker, when I get rid of the <img> tag the CORB error message goes away. Now my page displays the download URL. How do I convert the download URL into the HTML file?

– Thomas David Kehoe
Mar 25 at 17:37





Thanks stackoverflow.com/users/441757/sideshowbarker, when I get rid of the <img> tag the CORB error message goes away. Now my page displays the download URL. How do I convert the download URL into the HTML file?

– Thomas David Kehoe
Mar 25 at 17:37













I'm using $http.get(downloadURL). It's almost working, my template is displaying the file, but the HTML tags are showing as well...

– Thomas David Kehoe
Mar 25 at 17:45





I'm using $http.get(downloadURL). It's almost working, my template is displaying the file, but the HTML tags are showing as well...

– Thomas David Kehoe
Mar 25 at 17:45










1 Answer
1






active

oldest

votes


















0














sideshowbarker was right, the problem was I was using <img> to display an HTML text file. When I got rid of the <img> tag the CORB error went away. Instead I used $http.get(downloadURL) to get the file, then $sce.trustAsHtml(doc.data); to sanitize the HTML, then in the AngularJS template I used <div ng-bind-html="myFile"></div> to display it in the template. Here's the AngularJS controller code:



firebase.firestore().collection('Videos').doc($scope.longLanguage).collection($scope.longLanguage + '_Videos').doc($scope.movieTitle).collection('Clips').doc($scope.movieTitle + '_999999').get()
.then(function(doc)
$http.get(doc.data().lyricsDownloadURL)
.then(function(doc)
$scope.lyrics = $sce.trustAsHtml(doc.data);
)
.catch(error => console.error(error));
)
.catch(error => console.error(error));


and here's the AngularJS template:



<div class="col-sm-6 col-md-6 col-lg-6">
<div ng-bind-html="lyrics"></div>
</div>





share|improve this answer






















    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55341669%2fcross-origin-read-blocking-corb-error-with-firebase-storage%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    sideshowbarker was right, the problem was I was using <img> to display an HTML text file. When I got rid of the <img> tag the CORB error went away. Instead I used $http.get(downloadURL) to get the file, then $sce.trustAsHtml(doc.data); to sanitize the HTML, then in the AngularJS template I used <div ng-bind-html="myFile"></div> to display it in the template. Here's the AngularJS controller code:



    firebase.firestore().collection('Videos').doc($scope.longLanguage).collection($scope.longLanguage + '_Videos').doc($scope.movieTitle).collection('Clips').doc($scope.movieTitle + '_999999').get()
    .then(function(doc)
    $http.get(doc.data().lyricsDownloadURL)
    .then(function(doc)
    $scope.lyrics = $sce.trustAsHtml(doc.data);
    )
    .catch(error => console.error(error));
    )
    .catch(error => console.error(error));


    and here's the AngularJS template:



    <div class="col-sm-6 col-md-6 col-lg-6">
    <div ng-bind-html="lyrics"></div>
    </div>





    share|improve this answer



























      0














      sideshowbarker was right, the problem was I was using <img> to display an HTML text file. When I got rid of the <img> tag the CORB error went away. Instead I used $http.get(downloadURL) to get the file, then $sce.trustAsHtml(doc.data); to sanitize the HTML, then in the AngularJS template I used <div ng-bind-html="myFile"></div> to display it in the template. Here's the AngularJS controller code:



      firebase.firestore().collection('Videos').doc($scope.longLanguage).collection($scope.longLanguage + '_Videos').doc($scope.movieTitle).collection('Clips').doc($scope.movieTitle + '_999999').get()
      .then(function(doc)
      $http.get(doc.data().lyricsDownloadURL)
      .then(function(doc)
      $scope.lyrics = $sce.trustAsHtml(doc.data);
      )
      .catch(error => console.error(error));
      )
      .catch(error => console.error(error));


      and here's the AngularJS template:



      <div class="col-sm-6 col-md-6 col-lg-6">
      <div ng-bind-html="lyrics"></div>
      </div>





      share|improve this answer

























        0












        0








        0







        sideshowbarker was right, the problem was I was using <img> to display an HTML text file. When I got rid of the <img> tag the CORB error went away. Instead I used $http.get(downloadURL) to get the file, then $sce.trustAsHtml(doc.data); to sanitize the HTML, then in the AngularJS template I used <div ng-bind-html="myFile"></div> to display it in the template. Here's the AngularJS controller code:



        firebase.firestore().collection('Videos').doc($scope.longLanguage).collection($scope.longLanguage + '_Videos').doc($scope.movieTitle).collection('Clips').doc($scope.movieTitle + '_999999').get()
        .then(function(doc)
        $http.get(doc.data().lyricsDownloadURL)
        .then(function(doc)
        $scope.lyrics = $sce.trustAsHtml(doc.data);
        )
        .catch(error => console.error(error));
        )
        .catch(error => console.error(error));


        and here's the AngularJS template:



        <div class="col-sm-6 col-md-6 col-lg-6">
        <div ng-bind-html="lyrics"></div>
        </div>





        share|improve this answer













        sideshowbarker was right, the problem was I was using <img> to display an HTML text file. When I got rid of the <img> tag the CORB error went away. Instead I used $http.get(downloadURL) to get the file, then $sce.trustAsHtml(doc.data); to sanitize the HTML, then in the AngularJS template I used <div ng-bind-html="myFile"></div> to display it in the template. Here's the AngularJS controller code:



        firebase.firestore().collection('Videos').doc($scope.longLanguage).collection($scope.longLanguage + '_Videos').doc($scope.movieTitle).collection('Clips').doc($scope.movieTitle + '_999999').get()
        .then(function(doc)
        $http.get(doc.data().lyricsDownloadURL)
        .then(function(doc)
        $scope.lyrics = $sce.trustAsHtml(doc.data);
        )
        .catch(error => console.error(error));
        )
        .catch(error => console.error(error));


        and here's the AngularJS template:



        <div class="col-sm-6 col-md-6 col-lg-6">
        <div ng-bind-html="lyrics"></div>
        </div>






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 25 at 17:59









        Thomas David KehoeThomas David Kehoe

        2,6511 gold badge16 silver badges44 bronze badges




        2,6511 gold badge16 silver badges44 bronze badges
















            Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







            Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55341669%2fcross-origin-read-blocking-corb-error-with-firebase-storage%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

            Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript