Safari is showing an error stating that the object BlobConstructor is not a valid constructor

Encountering an issue in Safari on Windows 7 within this specific section

'[object BlobConstructor]' is not a constructor (evaluating 'new Blob([data], {type: 'application/pdf'})')

After trying the solution mentioned in Blob constructor not working in safari / opera?

'[object BlobConstructor]' is not a constructor (evaluating 'new Blob([data.buffer], {type: 'application/pdf'})')

Utilizing the following Blob code snippet

var file = new Blob([data], {type: 'application/pdf'});

The complete code block is as follows:

      $scope.pdffile = "";
      $http.get('/api/myurl/'+report_id, {responseType: 'arraybuffer'})
         .success(function (data) {
             var file = new Blob([data], {type: 'application/pdf'});
             var fileURL = URL.createObjectURL(file);
             $scope.pdfcontent = $sce.trustAsResourceUrl(fileURL);
             $scope.pdffile = "download.pdf";
             $scope.loading = false;
      });

Answer №1

Back in 2012, Apple made the decision to end Windows support for Safari 6.

It seems that the version you are currently using is version 5, which unfortunately does not have the ability to support Blob API according to this source.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Have you ever wondered why the Chart is being added to the current div when employing ng-repeat?

I have successfully created a dynamic bar chart and placed it inside a div. However, when I try to achieve the same result using ng-repeat, the new chart is appended to the existing one. Below is my code: HTML: <div id="main" class="drop-container" ...

What is preventing me from using bracket notation with a variable to assign a property to an object?

I am a complete beginner when it comes to Vuex, and I am currently facing an issue with assigning a value to a Vuex state, specifically state.map.status.isReady. To make my code more reusable, I decided to create a function called changeMapStatus(state, k ...

Issue with dropdown list functionality in Internet Explorer not functioning correctly

I am experiencing an issue with my dropdown lists. When selecting an item from the first dropdown list, it should not be available in the second dropdown list. To achieve this functionality, I have implemented jQuery code like the following: $(document).r ...

Refresh the page before the conclusion of the express-Node js function

I am encountering an issue with a function that functions properly with small files but fails when dealing with large files. The problem occurs when the axios post request in Express JS ends, causing a page refresh. I am using React JS on the client side a ...

Trouble receiving Ajax response

Below is the code snippet I am working on: function f(){ var value = ""; var request1 = $.ajax({ url : '/a', type: "GET" }); var request2 = $.ajax({ url: '/b', type: ...

AngularJS Login Authorization: Restricting user access to specific pages, allowing only login and registration pages to be navigated

I'm currently working on a web application using the AngularJS framework for the frontend. I need to restrict users from navigating to any page other than the login and registration pages on my site. However, my current code is blocking access to the ...

Shake things up with a dynamic combination of two select or dropdown fields

I'm struggling with implementing full functionality in JS. Currently, I have two select fields with different options: <select name="" id="filter-position"> <option value="all">Filter by position</option> <option ...

Organizing child directives within a main template

Currently, I am in the process of creating a new directive called "info-card". My vision is to utilize it in the following manner: <info-card theme="light"> <info-header> <h2>Hello World</h2> </info-header> ...

Issue: $injector:nomod Module Not Found

Over the weekend, I encountered an issue where suddenly the angularjs code on the website stopped functioning. No changes were made to any files during the time it was operational and then ceased to work. The error message displayed in the console is "Err ...

Is there a way to extract the username from an email address using JavaScript?

I currently have an email list, however I am looking for a way to extract the username by deleting all characters following the @ symbol. Can anyone suggest a regex solution in javascript? var input = "<a href="/cdn-cgi/l/email-protection" class="__c ...

The toArray function in MongoDB does not support the use of Array push

I'm attempting to loop through all documents within collections, store them in a global variable, but it seems like the push() function is not working and returning an empty array [] inside of toArray(). Any ideas? const mongo = require('mongodb ...

Angular JS popovers displayed consistently on all pages throughout the application

I'm currently developing a web app using Angular 1 and I'm looking to incorporate a popover feature that performs background checks on addresses as the user navigates through the application. Here's how it would work: When the user clicks o ...

Is it possible for the server to initiate communication with the client

Every time I try to find a solution, Comet always comes up. But it seems like overkill for what I need - just around 100 users at most, with maybe 10 online simultaneously. Is there a simpler and more suitable option for my needs, such as pushing data to ...

Building a Laravel Form for Uploading Images in Laravel 5.3

I need help with uploading an image first and getting the image file path before storing all the data, including the image, into a database in LARAVEL. Can someone please advise me on what steps I should take to accomplish this? ...

Generating a date from a string

Given two strings, `2017-03-15` (date) and `12:26` (time), the objective is to create a localized date object without relying on any library. Assuming the current date and time are: `Tue Mar 14 2017 12:26:33 GMT+0800 (AWST)`, using the code: new Date( da ...

Check out the Pa11y JSON configuration file specifically designed for actions by visiting the following link: https://github.com/pa11y/pa11

Our automated accessibility testing is conducted using the Jenkins CI tool with the help of pa11y. Below is the Jenkinsfile used to execute these tests: node('mypod') { container('centos') { def NODEJS_HOME env.NODEJS_HOME = "${t ...

Exploring different sections of the website

I am looking to create a seamless navigation experience between controls on a webpage. Below is an example code snippet that outlines the functionality where a user can click on any component and be directed to another controller. Sample code: const app ...

Angular is able to asynchronously make an API call and then effectively utilize the returned data

I am attempting to make an API call ngOnInit(){ this.function1() } function1(){ this.userService.getUser() .then((data) => { this.user = data.user this.userM = data.userM // I have a problem here: When I console.log(this.userM) it starts of ...

Include a query parameter each time a page is added to bookmarks

Is there a way to automatically add a query parameter to a page URL when bookmarked using Chrome? For example, if I bookmark https://www.example.com, can it be saved as https://www.example.com/?bookmarked? I'm thinking I might need to use JavaScript ...

Prevent background music from being manipulated

I've implemented an audio HTML element with background music for a game: <audio class="music" src="..." loop></audio> However, I have encountered an issue where upon loading the page, I am able to control the music usi ...