Webkitblobresource ошибка 1 что это

Невозможно загрузить PDF в браузере Safari на iphone или ipad pro ios12 В моем веб-приложении есть функция загрузки PDF-файлов. Он отлично работает со

Невозможно загрузить 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. Пишите результаты в комментариях; если проблема не решается, будем бороться с ней вместе!

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]

    64
    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?

    368
    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.

    1552
    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

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!

Created attachment 351778 [details]
Download methods

Overview:
In our webapp construct 3 users can download a copy of their project. When saving projects are serialized into a blob ( zip format ) on the client side. To download the file we create a Blob URL, attach it to a new HTMLAnchorElement, specify the "download" attribute as the file name ( "myproject.c3p" ) and use the HTMLElement.prototype.click function. This method works correctly in Safari 11 and in chrome. However, now it opens a new tab displaying a WebKitBlobResource error 1 and no further information.

I think this may be related to the content blocker. On the first attempt to repeat this a "popup blocked" error will appear in the address bar and allowing it will download and unzip the project into a folder called "unknown" ( which I consider broken also ). Subsequent attempts will display the WebkitBlobResource error.

I have attempted to create a simple replication for this, but even when copying the exact code into a new document and calling in the same fashion ( the development tools REPL ) it only repeats in the actual web application.

I have included the download methods, but it's fairly standard stuff.

Steps to reproduce:
1. Visit https://editor.construct.net
2. Select "new project"
3. Select "menu > project > save as > download a copy"
4. Select "ok" ( uses default name )
5. Allow popup
6. Observe "unknown" folder appearing in downloads folder
7. Repeat steps 2 - 4
8. Observe error tab

Actual results:
A new tab displaying the error: Safari can't open the page "blob:https://editor.construct.net/[ blob id ]". The error is: "The operation couldn't be completed. (WebkitBlobResource error 1.)" (WebkitBlobResource:1)

Expected Results:
A new file in the downloads folder called "New project.c3p"


Comment 2


Chris Dumez



2018-10-09 09:43:43 PDT

Issue seems to come from the fact that target=_blank is used:
1. This triggers Safari's popup blocker. If you allow the popup later on, the filename is wrong because Safari does not know about the download attribute.
2. If popups are allowed, WebKit tries to *load* the blob instead of *downloading* it, thus the network error. This is due to a bug in our createNewWindow code path which I will fix.


Comment 4


Chris Dumez



2018-10-09 10:00:25 PDT

In a follow-up, I will look into ignoring the target when the download attribute is present. The HTML spec says to download the hyperlink instead of following the hyperlink. Only the "following the hyperlink" algorithm checks the frame name.


Comment 6


Ashley Gullen



2018-10-09 10:20:45 PDT

Ah, thanks for the tip about target=_blank - setting target=_self on any download attribute links seems to work around it. We'll ship this workaround soon so to continue reproducing the issue use the following link which will use a specific version of our PWA: https://editor.construct.net/r121/


Comment 8


Chris Dumez



2018-10-09 10:45:05 PDT

(In reply to Ashley Gullen from comment #6)
> Ah, thanks for the tip about target=_blank - setting target=_self on any
> download attribute links seems to work around it. We'll ship this workaround
> soon so to continue reproducing the issue use the following link which will
> use a specific version of our PWA: https://editor.construct.net/r121/

Great, thanks.


Comment 10


WebKit Commit Bot



2018-10-09 11:25:41 PDT

All reviewed patches have been landed.  Closing bug.


Comment 11


Chris Dumez



2018-10-09 12:37:43 PDT

Follow-up to avoid Safari's popup blocking at Bug 190408.


Comment 12


Michaela Merz



2019-04-30 10:39:01 PDT

Unfortunately - it's not fixed. We are running into the same problem. A blob is assembled in Javascript, it's set into a download-URL with download attribute and it can be downloaded with Chrome, Firefox and Epiphany (webkit2gtk-4.0). We are not using frames, there's no difference with target="_self" or no target attribute, the error appears regardless of Content-Security-Settings and there is no warning or error on the console. 

Safari just opens a new tab and displays the "WebKitBlobResource error 1.). It worked fine in previous versions of Safari (on MacOS). 

Copying the generated BLOB:url into safari's URL bar allows the download of the data. 

Safari Version 12.1 (14607.1.40.1.4)


Comment 13


Ashley Gullen



2019-04-30 11:08:36 PDT

You should probably file a new issue for that, it sounds different to this one if the target doesn't affect it.


Comment 14


Michaela Merz



2019-04-30 11:12:50 PDT

It seems to be related as it behaves exactly like the original bug as posted. Only difference: We are not using iframe and target attributes. We tried with target="_self" but that didn't influence the bug. Safari just opens a new tab and displays the error.


Comment 15


Michaela Merz



2019-04-30 11:54:36 PDT

Here's an update to the bug:

Test on Image in blob.

I can .. right click open the context-menu for a blob URL and 

.. Open in new tab: Displays Image
.. Open in new page: Displays Image 
.. Download: Downloads  the image

The *only* bug is that Safari opens a new tab after clicking the "a href" and displays the WebKitBlobResource error 1. It completely ignores the download attribute (for this blob) and it opens a new tab for now reason.


Comment 16


Ashley Gullen



2019-04-30 12:53:17 PDT

I really think you should file a new issue. This is a closed issue and people tend to stop looking at them once they're marked fixed. And it's entirely possible there are two separate problems with similar looking symptoms.


Comment 17


Chris Dumez



2019-04-30 14:13:20 PDT

(In reply to Ashley Gullen from comment #16)
> I really think you should file a new issue. This is a closed issue and
> people tend to stop looking at them once they're marked fixed. And it's
> entirely possible there are two separate problems with similar looking
> symptoms.

Yes, please file a new bug with your repro steps and cc me.


Comment 19


Andy Schmidt



2020-05-01 11:04:48 PDT

(In reply to Chris Dumez from comment #17)
> (In reply to Ashley Gullen from comment #16)
> > I really think you should file a new issue. This is a closed issue and
> > people tend to stop looking at them once they're marked fixed. And it's
> > entirely possible there are two separate problems with similar looking
> > symptoms.
> 
> Yes, please file a new bug with your repro steps and cc me.

New bug created for the never-fixed additional circumstances:
https://bugs.webkit.org/show_bug.cgi?id=211234

Still happening as recent as Safari 13.1 on iOS 13.4.


Comment 20


ihar.suvorau



2021-06-28 08:03:51 PDT

The issues is still relevant in Safari 14.2, WebKit 16612.1.17.10.5 and Version 14.1.1 (16611.2.7.1.4) on macOS 11.4 (20F71).

The workaround to create a workable link was to add the "download" attribute to a-tag: 

<a href=blobURL download=file.name>text</a>

In that way Safari downloads a file without following the link.

Понравилась статья? Поделить с друзьями:
  • Webkit encountered an internal error что это
  • Webio dll ошибка
  • Webhook 400 error
  • Webgl player settings как изменить настройки
  • Webgl is not available please restart your browser как исправить