How can I resolve "Body has already been consumed" error? - service-worker

I stepped over a post, that describes, how to add a notification, when in a Blazor Wasm an update is available. I exactly followed the instruction but did not modify service-worker.js but service-worker.published.js because I wanted to test it in production. I also added the "periodically check for updates" mentioned at the bottom of the post.
Everything works fine in Chrome, Edge and Safari but not in Firefox. When I upload an update, after a while, the service worker checks for updates and all browsers show the notification button. Clicking the button in Chrome, Edge and Safari results in reloading the updated page. Firefox gets stuck at the loading screen and displays the following errors:
Someone reported this as a bug at aspnetcore and since they found out it must be a Firefox bug also at bugzilla. There it was discussed and finally got the status fixed. But I still get this error with the latest version of Firefox.
How can I fix this?

Related

iOS dialogs don't open in app, but in background

After my cordova app is launched on iOS, the authorisation dialogs ("Do you want to grant access to your position?" etc.) do not appear in the app itself, but only open once the app is sent to the background and then reopened. This is obviously unreasonable for the user.
I'm having the same issue with the inAppBrowser, which only triggers once the app is reopened from the background.
Depending on the cordova CLI version I use to build, the results change for the better or worse. No error message anywhere.
Is there any plugin, setting or something else that could cause this behavior?
Answering my own question:
This happened because of a
<meta http-equiv="Content-Security-Policy">
in the head of the programm. Removing this fixed the issue and everything works like it should.

Why is Remote Debugging for Safari Mobile so inconsistent?

I've been developing JavaScript for many years with OSX and Mobile Safari, and I've noticed Remote Debugging has ALWAYS been extremely inconsistent.
Currently, I am running Safari 10.0 on El Capitan 10.11.6, and iOS 10.0.2 (the latest), and I'm not getting it to work AT ALL. I actually hadn't attempted to use this feature for several months before recently, so not sure if maybe the feature is just completely broken now.
In the past, if you quit Safari Mobile, and quit Safari (desktop) both, then started them back up, sometimes it would begin working, and then sometimes continue to not work (shows "No Inspectable Applications", or device doesn't show in menu). I am NOT changing any settings between these steps, and I know they are what they should be according to documentation, and tips I've read.
Develop menu is on. Web Inspector is enabled. Fraudulent Website Warnings is off (someone suggested this has something to do with it). iOS is open, and on a web page.
I know other people who've encountered this exact problem again and again. It seems that it is clearly a bug that Apple needs to resolve. I know how to use weinre, and this is a great workaround; however, it is highly irritating to waste my time trying to get this to work several (many) times, and then have to give up, and go set up weinre every time (it happens a lot).
So! I've read through several StackOverflow topics on this (can't find them ATM), but none of them that I've seen specifically address the spottiness of this issue, or how to solve it once and for all.

iOS Facebook Login "Given URL is not allowed by the Application configuration"

Believe me, I have read all the other questions on this topic. None of them solved my problem (or were even quite the same problem). Facebook login has been working perfectly fine for me for weeks... Until yesterday when suddenly it started breaking and giving me this error.
Before yesterday, when I logged into my app with the Facebook SDK logInWithReadPermissions method, it would say "You've already authorized [app name]!" and be perfectly happy to log me in and move on. Then suddenly it started failing with this error:
Given URL is not allowed by the Application configuration: One or more of the given URLs is not allowed by the App's settings. To use this URL you must add a valid native platform in your App's settings.
The weird part is I hadn't changed any of the Facebook app's settings at all. This just suddenly started happening; five minutes before it worked, next build it didn't. Nevertheless, I looked up the error message and found a ton of things people suggested to do on the facebook developer page to fix the problem... Mostly involving the Valid OAuth redirect URIs field, not that I could quite get a clear answer of what you're supposed to put in there for an iOS app... They always said to put your website address. I don't have a website, I have an app... What gives?
So I knew I hadn't made any changes to the Facebook developer area to cause it to break, and I'd tried every change there that I could find on the internet. So I pulled down an old working copy to test that, on the off chance that somehow code I'd written was the problem. Nope; code from a week ago, that worked perfectly fine, still gives me the same message.
If the problem isn't in the code, and changing things on the FB site doesn't do it... I'm out of ideas. If there's something else I need to do on the FB app to fix this, suggest away and I'll give it a try... And if it works that's great, but I'm still not going to understand why it broke in the first place when I didn't make any changes... Anybody able to help me out?
I had exactly the same issue.
Actually you just have to add platform in your app settings
So here are the steps
Open https://developers.facebook.com and select your app
Settings > Basic > Add Platform
3.Now select iOS from the window and add your Bundle ID and rest of the information and click on Save changes
and that's it.
Hope it helps you .. All the best
I had exactly the same issue today.
Same thing Facebook kept saying "You've already authorized [app name]!" in the past. Which I found strange since all my other apps didn't display this message.
In the end I figured that I didn't add an iOS platform for the Facebook app in Settings. I don't understand why it worked before :)
So try to add an iOS platform and don't forget to add your bundle ID.
I hope this works for you :)
Ok, I remember having a similar problem with a website that used Facebook to apply a discount "friend of the business page? get x% off your order" - anyhoo, turns out I needed to add both the www and non-www versions of the website to the settings in the Facebook App (https://developers.facebook.com -> My App -> Settings -> App Domains)
I've revisited this and added "iOS" as a native platform (found at My App -> Settings) # This would be first thing to check. The second thing would be to look at the "Quick Start" section for further assistance, which can be found in the top-right section of that iOS app settings.
Facebook can and will change things willy-nilly so it's unpredictable as to when things break or not.
I'd be interested to know when/if and how you resolve this.

The “Guided Access is Enabled" message appears with every HTML form submission in iOS 8

I have a website set as a "home screen" app and accessed via Guided Access. The site contains a form. A message will appear every time there is an HTML form submission: "Guided Access is Enabled. Triple-click the home button to exit." This message is unexpected because all the user has done is submit a form.
This seems to be a new UI bug with iOS 8. During test of the same app with iOS 7 we did not see this issue at all.
There are a couple of similar reports and I've filed a bug report with Apple, but I'm wondering if anyone has found a work-around to suppress the message?
Here are two simple pages if you want to try to reproduce this issue:
http://jsbin.com/wecipi/1/
http://jsbin.com/mohira/1/
We experienced this bug with our app based on UIWebView. It is a bug in iOS 8 (I've seen others experience the same problem, and we've all filed reports to Apple).
For our app, our development team transforms all requests (only when Guided Access is enabled) with navigation type "UIWebViewNavigationTypeLinkClicked" to navigation type "UIWebViewNavigationTypeOther". This will restrict the message from appearing for most links.
You could try to do the same thing with "Form Submitted" and "Form Resubmitted" type links, though our development team believes doing so could potentially cause an error with loading the page (though I'm not sure if we ever tried it).
I hope this is helpful.
UIWebView to WKWebView ... works!
This seems to be fixed in iOS 9.

iOS dev center certificates, identifiers & profiles gets stuck in loading screen

I have this very frustrating issue with iOS dev center. Every time I want to add a new iOS-device by its UDID the site gets stuck in the loading screen. This same problem occurs when I want to change an existing distribution profile. The site just goes "Loading" forever.
Considering that this occurs on all my devices (computers, mobilephones etc.) I would be very grateful if someone had any idea how to deal with this problem..
Are you using Safari? For some reason the dev site doesn't always play nice with other browsers like Chrome and Firefox
I had the same issue for some time now. Actually even it is get stuck the device is added to my list. So just refresh the page after a while to see if it is added.
I did a bit of research into what the underlying issue was with this on Chrome. Seems there are multiple parts to this issue.
Firstly clearing cookies seem to help (partly) it got me past one hanging loading screen (first step of adding a new device), however I was still hanging on the next step.
Further investigation with Chrome developer tools indicated that Chrome was refusing to load some content due to XHR restrictions. Seems that Apple mixes https and http content. I was able to get past that by click on the shield icon on the right on the address bar and telling Chrome to allow the mixed content.
Finally there was also an issue with X-FRAME-OPTIONS headers that are being sent in the response which generate the following errors
Multiple 'X-Frame-Options' headers with conflicting values ('SAMEORIGIN, SAMEORIGIN, DENY') encountered when loading 'https://developer.apple.com/account/ios/device/deviceComplete.action?returnURL='. Falling back to 'DENY'.
Refused to display 'https://developer.apple.com/account/ios/device/deviceComplete.action?returnURL=' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN, SAMEORIGIN, DENY'.
There are a couple of extensions available to remove X-FRAME-OPTION headers, but I wasn't able to get those working and wouldn't really recommend it.
My guess is that this works ok on Safari as it's not as strict on the XHR and X-FRAME-OPTION rules.
Anyway hope that helps someone. I'm going to raise a support request with Apple to see if they can get it sorted.
I have same issue with Chrome and Safari on OS X but it works fine with Chrome on Ubuntu.
Try deleting the cookies in chrome settings.This has always helped me.

Resources