Меню

Webkitblobresource ошибка 1 что это сафари

Невозможно загрузить PDF в браузере Safari на iphone или ipad pro ios12

В моем веб-приложении есть функция загрузки PDF-файлов. Он отлично работает со всеми браузерами и iOS11, но не работает в браузере Safari и ios12 на мобильных устройствах или iod pro. Я получаю ошибку ниже — Ошибка WebKitBlobResource 1

1 ответ

Когда мы открываем pdf на новой вкладке url, файл не существует, а его единственный кеш хранится внутри браузера. Поэтому, когда мы генерируем большой двоичный объект и перенаправляем на текущую вкладку, чтобы указать на сгенерированный URL-адрес большого двоичного объекта, мы теряем кеш. Так что открытие URL-адреса в новом окне помогает.

В моем приложении Angular есть возможность загрузки в формате PDF. Когда я запускаю свое приложение в браузере Safari Iphone (IOS 12), я получаю следующее сообщение об ошибке, как показано на рисунке.

Как я могу это решить?

ios_safari_issue

Эй, ты нашел решение?

@RezaRahmati Еще нет

ты нашел решение?

Формы c голосовым вводом в React с помощью Speechly

Flatpickr: простой модуль календаря для вашего приложения на React

Что такое cURL в PHP? Встроенные функции и пример GET запроса

Ответы 1

Если вы внедряете тег ancor в DOM программно в качестве своего решения, убедитесь, что вы не проясняете это слишком рано.

Для меня 100 мс работали нормально, но, поскольку они невидимы в любом случае, я выбрал 1-секундную задержку при очистке DOM.

как насчет открытия этого файла для загрузки / новой вкладки? а.цель = «_blank»; кажется, сломал его и a.download = title; не работает на иос

Здесь это не так, поскольку фактическая загрузка происходит через запрос API и как объект Blob. Например, если пользователь должен быть авторизован с помощью токена доступа.

IPhone Safari «Не удается открыть страницу» или ошибка «Не удалось завершить операцию. Protocol error»

Safari – мобильный интернет браузер, программа, приложение для просмотри web-страниц, чаще всего используется как стандартное приложение в устройствах Apple. И ошибку, которую мы сегодня рассматриваем, часто замечают пользователи IPhone и IPad. Поэтому предлагаю рассмотреть причины появления такой ошибки в вэб-браузере Сафари, а также способы ее устранения.

Ошибка в браузере Safari IPhone Не удается открыть страницу или не удалось завершить операцию. Protocol error

Ошибка в браузере Safari IPhone Не удается открыть страницу или не удалось завершить операцию. Protocol error

Причины, почему Safari не удается открыть страницу или ошибка «Не удалось завершить операцию. Protocol error»

  1. Web-страница временно недоступна
  2. Нет подключения к интернет соединению
  3. Неверный адрес Web-страницы
  4. Устаревшая версия приложения, обновите или установите новый браузер из App Store
  5. Браузер Safari настроен неверно
  6. Разработчик Web-сайта запретил допуск или не добавил разрешение к допуску для открывания в этой программе.

Если у вас телефон перестал реагировать на зарядку или заряжается не полностью, читайте статью…

Способы решения появления ошибки

Первое, что необходимо сделать, это подождать некоторое время, т.к. возможно сайт, который вы хотите открыть, ограничен в работе из-за проведения технических работ, а администрация сайта на какое-то время прекратила доступ к ресурсу. Остается проверить доступ к иным страницам иных сайтов, ежели страницы открываются везде, кроме того, куда изначально пытались попасть, значит, сайт неактивен и траблы именно в нем.

Не знаете что делать если в вашем Айфоне закончилось свободная память? Статья в помощь…

Действенные методы решения

  1. Остановка JavaScript. В некоторых версиях операционной системы IOS есть ошибка, благодаря чему обозреватель Safari ограничивает допуск к некоторым сайтам. Чтобы решить такую проблему достаточно просто остановить джава скрипт. Открываем меню Настройки => Safari => Дополнения и переводим бегунок JavaScript в пассивное положение. После того, как вы получите возможность входа на необходимый сайт, следует проделать те же действия по включению ДжаваСкрипта обратно.
  2. Обнуление настроек Safari. Страницы web-сайта могут не отображаться из-за ошибки внутри приложения Сафари. Поэтому открываем меню Настройки => Safari => Очистить историю и данные сайтов.
  3. Отключение блокировки рекламы. В некоторых случаях юзеры IPhone юзают различные блокираторы рекламы. Бывает так, что именно из-за этих приложений не открываются необходимые сайты. Для того, чтобы отключить такой блокиратор, необходимо просто зажать кнопку обновление страницы в браузере Сафари и в открывшемся окне следует нажать пункт Перезагрузить без блокировки контента.

Заключение

Надеюсь, приведенные способы решения проблемы помогли вам справиться с ошибкой «Не удается открыть страницу» или ошибка «Не удалось завершить операцию. Protocol error» на мобильных устройствах IPhone и IPad. Пишите результаты в комментариях; если проблема не решается, будем бороться с ней вместе!

Update TLDR;

Blobs in indexeddb are unreliable in iOS Webkit. So instead save your blobs as array buffer and the type of the blob as a string in the indexeddb. You can get the ArrayBuffer and the type of a blob-like this:

await blob.arrayBuffer()
blob.type

When you want to retrieve the data from the indexeddb and display it just create a new blob from the ArrayBuffer and type:

const blob = new Blob([value.buffer], { type: value.type });
URL.createObjectURL(blob);

Investigation

I have a very similar issue on iOS WebKit / safari: I also store images and video blobs received from the server in the indexeddb. The blobs are then retrieved and converted to an URL with createObjectUrl(). This works perfectly on all browser engines except WebKit / safari. iOS WebKit / safari only works the first couple of times. I have not found a perfect solution but I can share my findings so far:

Generally, all comments to similar issues are saying «blobs on WebKit are unreliable».

There are some possible workarounds: https://stackoverflow.com/a/60075517/13517617 I still have to try this one though.

Also what we may can do is use the fileReader to create a base64 String and use this as src. instead of createObjectUrl(). This can be achieved like this:

const reader = new FileReader();
reader.readAsDataURL(blob);
reader.onloadend = () => {
const base64data = reader.result
};

This is not an ideal solution as we now have some callbacks.

There are some hints pointing to that the mime type of the blobs have to be specified correctly to make it work in iOS WebKit / safari all the time.

I will dig deeper and share my final answer here. Maybe some else is faster or has encountered this issue before.

Update TLDR;

Blobs in indexeddb are unreliable in iOS Webkit. So instead save your blobs as array buffer and the type of the blob as a string in the indexeddb. You can get the ArrayBuffer and the type of a blob-like this:

await blob.arrayBuffer()
blob.type

When you want to retrieve the data from the indexeddb and display it just create a new blob from the ArrayBuffer and type:

const blob = new Blob([value.buffer], { type: value.type });
URL.createObjectURL(blob);

Investigation

I have a very similar issue on iOS WebKit / safari: I also store images and video blobs received from the server in the indexeddb. The blobs are then retrieved and converted to an URL with createObjectUrl(). This works perfectly on all browser engines except WebKit / safari. iOS WebKit / safari only works the first couple of times. I have not found a perfect solution but I can share my findings so far:

Generally, all comments to similar issues are saying «blobs on WebKit are unreliable».

There are some possible workarounds: https://stackoverflow.com/a/60075517/13517617 I still have to try this one though.

Also what we may can do is use the fileReader to create a base64 String and use this as src. instead of createObjectUrl(). This can be achieved like this:

const reader = new FileReader();
reader.readAsDataURL(blob);
reader.onloadend = () => {
const base64data = reader.result
};

This is not an ideal solution as we now have some callbacks.

There are some hints pointing to that the mime type of the blobs have to be specified correctly to make it work in iOS WebKit / safari all the time.

I will dig deeper and share my final answer here. Maybe some else is faster or has encountered this issue before.

Looks like no one’s replied in a while. To start the conversation again, simply

ask a new question.

For safari browser in IOS version 12,

When tried to download the Bob resource, I am getting the «WebKitBlobResource error 1» error.

The same code is working on the safari browser in the earlier version of IOS.

Any help is much appreciated.

Thanks

Deepak Bansode

iPad Pro Wi-Fi,

iOS 12

Posted on Oct 3, 2018 2:43 AM

Similar questions

  • As of today, my Safari on all of my IOS devices is totally non functional.
    As stated, my Safari browser is non functional on both of my IOS devices. One device is an iphone 13 pro max and the other device is the latest version of the IPAD PRO MAX 13 “.

    I have deleted Safari as an app, then in trying to re download it, I get an error message that says that it is already downloaded when it fact it is NOT.

    Please advise. I am also hearing impaired.

    Best,

    Erik

    [Personal Information Edited by Moderator]

    63
    2

  • Safari won’t open Google maps
     Using iOS 14.3 on my iPad Air 2.  If I search for a destination with Safari, and then I tap on a map that shows up, the google map crashes, reloads and crashes again. Then I get the message: «A repeated error has occurred.» The same thing happens if I use Safari to go to google.com and then click on the map icon. This started happening after updating to OS 14.3.
    I have no other apps open when on Safari, and I just cleared all my storage and history. 
    I have posted this problem on the Google community support site. Lots of other people are having this problem since updating to any version of iOS 14.  The consistent reply from the Google experts is that «this is most likely a safari / ipad os 14.x issue.»
    Is Apple addressing this problem?

    360
    2

  • Safari users report problems downloading pdf files
    Recently, Safari users (Mac, ipad, iphone) have not been able to download or view pdf files generated for them by my site. This always worked before with Safari, but I don’t know when the problem started. Chrome, Edge, Brave, and Firefox all work fine, but Safari gives the error: [Safari cannot open the page. The error was: «cannot parse response».] My customers use a Mac or iPad, but I verified the problem via an iphone running IOS 14.4. I have searched the web for answers and have tried deleting cached files and cookies and even disabling experimental Safari features one-by-one. So far, nothing helps. I currently tell people to use Chrome, Brave, Firefox, or Edge, but I would rather not have to do that. Any insights will be appreciated.

    1517
    1

1 reply


Question marked as

Helpful


User profile for user:

Community User

Nov 18, 2018 12:08 AM in response to DEEPAKBANSODE

Same Behavior in IPhone-X IoS / Safari 12 , blob PDFs aren’t downloaded or previewed properly in Safari.

While trying the same on Chrome in the same Device it works as expected and as Deepak noted its indeed working in earlier version of IoS/Safari 9.

Is that a security issue or a buggy situation with the Safari’s WebKit.

Thanks in advance.

1 reply


Question marked as

Helpful


User profile for user:

Community User

Nov 18, 2018 12:08 AM in response to DEEPAKBANSODE

Same Behavior in IPhone-X IoS / Safari 12 , blob PDFs aren’t downloaded or previewed properly in Safari.

While trying the same on Chrome in the same Device it works as expected and as Deepak noted its indeed working in earlier version of IoS/Safari 9.

Is that a security issue or a buggy situation with the Safari’s WebKit.

Thanks in advance.

WebKitBlobResource error 1

Are you trying to browse the internet using Safari, but are you getting the error message ‘webkitblobresource error 1’?

Safari is a web browser that was developed by Apple Inc. It was released on January 7, 2003 for Mac OS X and it has been available on various other operating systems such as iOS, Android, Windows and Linux.

Tech Support 24/7

Ask a Tech Specialist Online

Connect with the Expert via email, text or phone. Include photos, documents, and more. Get step-by-step instructions from verified Tech Support Specialists.

Ask a Tech Specialist Online

On this page, you will find more information about the most common causes and most relevant solutions for the Safari error ‘webkitblobresource error 1’. Do you need help straight away? Visit our support page.

Error information

Tech Support 24/7

Ask a Tech Specialist Online

Connect with the Expert via email, text or phone. Include photos, documents, and more. Get step-by-step instructions from verified Tech Support Specialists.

Ask a Tech Specialist Online

Verified solution

The default homepage of Safari is your browser’s home page or your personal website. You can set up different pages as your homepage in Safari. However, if you encounter a Safari error that says WebKitBlobResource then you might have a problem with the page that you are trying to visit. This error can occur when you try to visit certain websites or when you try to download a specific file from the internet.

The problem can be caused by an issue with your computer or it can be caused by a virus or malware on your computer. Sometimes, problems with the internet connection of your computer can prevent you from accessing certain websites properly. To fix this error, you need to try a few solutions.

You might be getting the WebKitBlobResource Error 1 code when you are trying to download a PDF file from the internet. If this is the case, first of all, consider bugs and glitches that can occur with PDF files. Try downloading a different PDF file from the internet and check if the problem persists. Bugs and glitches can also be Safari’s problem. This means that the problem is on the developer’s side and not on your side.

The developers might have a bug in their software that can prevent you from accessing certain websites or PDF files properly. So, you need to wait for the developers to fix this bug. This might take a few days or weeks, depending on the time that the developers take to fix this bug. You can try downloading the file again and check if the problem persists.

Another possible solution is to download the PDF file directly from the original website. Some websites might be protected behind a log-in or password system. Strange download links can be the result of these log-in systems. So, try downloading the PDF file directly from the original website and check if the problem persists.

If you are still encountering the WebKitBlobResource Error 1, you might need to clear your browser’s cache. You can also try reinstalling Safari. If this does not work, then you need to contact the support team. You can contact them through email or by calling them.

Need more help?

Do you need more help?

Tech experts are ready to answer your questions.

Ask a question

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.

Already on GitHub?
Sign in
to your account

Comments

@paintedbicycle

Describe the bug

In Safari, there is now a new error, where there wasn’t in previous versions.

Failed to load resource: The operation couldn’t be completed. (WebKitBlobResource error 1.)

The PDF then never renders in Safari.
This doesn’t happen in Chrome.

To Reproduce
Make and render a PDF in browser, using Safari.

    <PDFViewer style={{ height: '100%' }}>
      <Document>
        <Page size="A4" style={PDFStyles.page}>
          <View style={PDFStyles.section}>
             [Content]
          </View>
        </Page>
      </Document>
    </PDFViewer>

Desktop (please complete the following information):

  • OS: [e.g. MacOS]
  • Browser [e.g safari]
  • React-pdf version [e.g. v1.4.1]

@paintedbicycle
paintedbicycle

changed the title
Failed to load resource: The operation couldn’t be completed. (WebKitBlobResource error 1.)

[Regression] Failed to load resource: The operation couldn’t be completed. (WebKitBlobResource error 1.)

Mar 19, 2019

@diegomura

Thanks for reporting this. I couldn’t replicate it in desktop.
My OS is updated: macOS Mojave 10.14.3 (18D109).
Did you see this in desktop or mobile?

@paintedbicycle

It was desktop, yeah, all up to date. Latest react, etc, etc.

I’ll try to find some time in the next couple days to look into it further.

Paul

@paintedbicycle
paintedbicycle

changed the title
[Regression] Failed to load resource: The operation couldn’t be completed. (WebKitBlobResource error 1.)

Failed to load resource: The operation couldn’t be completed. (WebKitBlobResource error 1.)

Apr 16, 2019

@paintedbicycle

This appears to be caused by the use of <PDFViewer>. When I try to playground, it doesn’t happen and when I comment out the viewer, I can render it a bunch of times in a row successfully.

It happens on both localhost and a custom domain.

So, in Safari, it will sometimes render the PDF but then if you close the PDF and try again, it will often block — with the viewer opening, but a blank white PDF. Then, often closing the browser window and trying to render again will be successful. Other times you need to do that a few times. It’s quite inconsistent.

I’d say the error rate is about 30-40 percent of the times trying to render the, so it’s pretty frequent.

@paintedbicycle

Please let me know if there is anything I can get you to help troubleshoot and move this issue along. It effectively means Safari users cannot generate PDFs.

@ivantodorovich

@tchakabam

This issue happening on Safari is likely due to jamming the main event loop with either too long ticks i.e execution stacks. Or too many timeouts scheduled in a short time i.e too frequently.

That is what I was able to conclude, while I was seeing this error with a completely different type of application than this PDF lib here.

It seems that some microtasks then just get dropped of the queue, which causes some of the async blob-data-extraction resolutions to just fail like this 🙂 It seems to be somewhat cut off in the depths of the runtime, as at the JS layer I would see this error in the console, but there wasnt any place where I could actually catch this promise rejection anywhere that it would claim 🙂 Sort of buggy behavior indeed, at least as the catch-handlers I set on those Blob#arrayBuffer methods never get called (in my case I dont convert the data to a file for download, but I get data as messages from an RTC channel, which uses blobs internally).

EDIT: Was almost omitting to clearly give the helpful info to fix/workaround (but pretty much gave it above): When you try to access the blob data in any way, you need to make sure you reduce the «pressure» on the main thread in any way. That means, defer/slice all tasks in any way possible that might «block» it. Or even use a worker. Unfortunately the issue here is that this error seems not catchable that well, so it is not possible to implement retry (wasnt in my case at least).

@diegomura

Thanks @tchakabam for the explanation. Although I’m a bit lost on this subject. Do you think there’s something on this lib side that can be done? Also, if possible try using the 2.0 that ships better memory usage, it might be solved as well. Thanks!

I’m trying to read a rather big file in chunks using FileReader (File selected from a field). Works fine on Android, Chrome, Firefox etc., but somehow on iOS Safari the FileReader stops reading the chunks exactly after 60 seconds. The error I am seeing is WebkitBlobResource error 1. Makes me wonder if this is some kind of permission error or somehow iOS Safari revokes the File blob.

Sample code:

let file = <input type="file">

let chunkSizeToUse = (1024 * 1024) // 1 MB chunks
let offset = (0 - chunkSizeToUse)

let readInterval = setInterval(() => {
    if(offset < file.size){
        offset += chunkSizeToUse

        let fileReader = new FileReader()

        fileReader.onload = () => {
            let arrayBuffer = fileReader.result

            //further chunk processing
        }

        fileReader.onerror = (err) => {
            console.log(err) // WebkitBlobResource error 1 exactly after 60 seconds of processing
        }

        fileReader.readAsArrayBuffer(file.slice(offset, (offset + chunkSizeToUse)))
    }
    else{
        clearInterval(readInterval)
    }
}, 100)

For easier and direct debugging on an iOS device using Safari I’m gonna link this JSFiddle:

https://jsfiddle.net/L17uymvp

Just select a file and wait for the counter do go to zero.

All of this makes it impossible for some users to upload large files. Our webapp processes each chunk individually (encryption), so we have to work with chunks.

My Angular application has a pdf download option. When i run my application in Iphone(IOS 12) Safari browser I get the following error message as shown in the image

How can i resolve it?

ios_safari_issue

shizhen's user avatar

shizhen

11.9k9 gold badges52 silver badges86 bronze badges

asked Jan 24, 2019 at 4:57

Saikrishna SB's user avatar

3

If you are injecting an ancor tag into DOM programmatically as your solution, make sure you do not clear that up too soon.

For me 100ms worked fine but since it’s invisible either way I chose 1 second delay on clearing DOM up.

Example code:

this.fileApi.download(<your args>).subscribe((data: Blob) => {
    const url = window.URL.createObjectURL(data);
    const a = document.createElement('a');
    a.style.display = 'none';
    a.href = url;

    // the filename you want
    a.download = <your filename>;
    document.body.appendChild(a);
    a.click();

    setTimeout(() => {
      window.URL.revokeObjectURL(url);
      document.body.removeChild(a);
    }, 1000);
  })

answered Feb 3, 2020 at 12:19

Raimo Johanson's user avatar

3

0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии

А вот еще интересные материалы:

  • Яшка сломя голову остановился исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного где ошибка
  • Webkit dll 1c ошибка
  • Webio dll ошибка как устранить