Flash player redirect issues in Microsoft Edge - actionscript-3

For some reason Microsoft Edge's flash player doesn't properly load urls with redirects.
I'm trying to load a file from CDN using urlLoader.load(). I make a request to https://cdn.example.com/path/name and server redirects me to https://edge-01.example.com/path/name with HTTP 302.
In other browsers everything works fine. I can get the file and see two crossdomain requests (for CDN and edge-01). In case of MS Edge I can only see crossdomain request for CDN. Redirected request to edge-01 stucks and in a minute returns HTTP 408.
Any ideas or workarounds on this?

Related

NTLM authentication doesn't work for JS files unless Fiddler is running

I am running an ASP.NET 4 app in IIS using NTLM (Windows) Authentication. All other authentication schemes are disabled. I am able to authenticate to the server successfully. However, even after successfully authenticating, the server (under certain circumstances explained below) still returns a 401 Unauthorized error when I request Javascript files. Why am I unauthorized to download JS files?
Granted, I don't completely understand how NTLM works, but I expect something like the following to happen when I request a protected resource:
I make a request to localhost:444 (yes, this is the correct port)
I am not authenticated, so IIS returns a 401 to my web browser.
My web browser understands that it must provide me with a popup in which to enter my username and password. I do so.
The browser and IIS perform the NTLM auth flow. (tbh, I don't know the details of this.) Authentication is successful. The browser understands to re-request my original request from Step 1.
IIS returns index.html.
Index.html references a CSS file and some JS files. The browser requests these files.
IIS returns these files.
This desired functionality is working... usually. When I'm accessing the site from Firefox, or Chrome 78, or Chrome 83, everything works as expected. However, when I access the site using Chrome 70, the following happens instead:
Steps 1 thru 5 work correctly as explained above.
Index.html references a CSS file and some JS files. The browser requests these files.
IIS returns the CSS file, but returns a 401 error for the JS file.
Then however, when I turned on Fiddler (and configured it to decrypt https, because I've been using https) Chrome 70 started behaving correctly, just like Firefox and Chrome 78 and Chrome 83 are. I turned Fiddler off again, and I got the same error (on my JS file) again.
Does anyone have any idea what the issue is?
Thanks!
The issue was not with the authentication; the authentication was working correctly.
The issue was with Angular 8/9 and Chome 70. I happened across this post which helped me discover this forum thread which (sortof) explains the issue.
Turns out, Angular 8 changed the way the the index.html formats its script tag. In Angular 8+, the tag makes use of JS modules and such, and includes a fall-back for browsers that don't support JS modules. However, Chrome 70 (and possibly others) seems to support JS modules poorly (I don't understand the exact nuances of what Chrome 70 does and doesn't do). Therefore, instead of using the fall-back for browsers that don't support JS modules, Chrome 70 seems to have made a malformed request for the JS files. Specifically, Chrome 70 requested the JS files, but requested their MIME type to be "text/plain" instead of "text/javascript". When IIS received this (assumedly) malformed request, it returned a 401 error. (I would've thought it would return a 400 error, but whatever.)
I don't know why turning on Fiddler fixed the issue. Maybe Fiddler was somehow changing the (assumedly) malformed headers to be correct again? I don't know.
The solution is easy - in your tsconfig.json file, simply set the target to "es5" instead of "es2015" (or whatever else is the default in the future). Compiling to es5 simply doesn't use the features that confuse Chrome 70.

Failed to Load Resource, Plugin Handled Load on iOS

Every time I try to view a video file on my server I get this error on iOS in Safari, Chrome.
I am using a blob server and then an Apache server so I am not sure what the problem is. However, when I only use Apache, I do get this error but then I have the video rendering too.
However when I render this using my server this is not working. Does anyone know why this is? The videos work fine on other devices and in browsers also works fine if accessed through Apache only.
The solution to this problem was just a work around. The reason being the that blob servers aren't streaming servers. iOS devices expect the videos to arrive in small chunks. So for instance a streaming server is able to do this. However, a blob server just hands the video as a blob which is not what the iOS device expects. Some browsers are smart enough to handle this but others not.
The way I solved this was to add the video files outside of the blob server in a folder within the project and then render this through the Apache server instead of serving it via the actual blob server we were using. I hope this helps.
I was also getting this error for some mp4 videos. Turns out it wasn't a server issue for me it was a video encoding issue.
Issue
A "moov atom" needs to be placed at the front of the video file. It serves as a table-of-contents for the video. That "moov atom" has to be read first for html streaming or it won't play on some devices.
The Fix
To fix, I used handbrake to transcode my video. Turn on 'web optimize' Also turning on zerolatency and 'fast decode' may help (found in the video tab).
We were getting a similar error here. I thought it may have been the streaming issue since our video was hosted in blob storage on Azure. After setting up a Media Service for streaming, the video still didn't work. It turns out, the cause of the bug for us was Safari using a Service Worker. Below is some further explanation of what we found:
Safari first sends a byte range request for a Video tag that expects a 206 response. However, if you use a Service worker, the response returns with a 200 and it appears Safari doesn't know how to handle this. Our solution was to exclude using a Service Worker for Safari.
We found this by using the network tab of the Safari debugger on a Macbook to troubleshoot the issue we were seeing on the iPad. Attached is a screenshot for comparison/reference. The left tab shows what the call should look like by default. The right tab shows what you would see if using a Service Worker.
Add the following line of code to your .htaccess (located in the root of your WordPress installation):
SetEnvIfNoCase Request_URI .(?:mp4)$ no-gzip dont-vary
The following screenshot is the new complete .htaccess
Reference: https://clickshepherd.com/blog/solved-elegant-themes-divi-and-cloudflare-mp4-media-error-formats-not-supported-or-sources-not-found/
In our case, we created a URL pattern for our blob assets and then set headers in that URL pattern definition page which sent back a mime type of 'video/mp4'. This should instruct the browser to treat the binary stream as chunked, which in turn meant we didn't need to download the whole thing before it started playing.
Google Cloud Platform Solution
This issue caused me a lot of headache, so I just wanted to add my specific solution here, if anyone else encounters this while deploying to Google Cloud Platform.
When trying to load MP4 videos in Safari, I was getting the same error:
"Failed to Load Resource, Plugin Handled Load"
Which was preventing the videos from playing.
Still, I wanted to try to keep everything inside Google Cloud, so I created a Storage Bucket for the site, and added the videos there.
Of course, trying to retrieve the videos from the storage URL from the main site resulted in a CORS error.
Fortunately, you can configure CORS pretty easily on storage buckets:
Configuring cross-origin resource sharing (CORS)
Once that configuration was deployed, I was able to retrieve and load the videos on the site in Safari without the "plugin handled load" error.
I saw the error "Failed to Load Resource" and though that this is reason, why my videos are not playing.
Turned out, my videos were missing the hvc1 tag. And when I added it - they're playing fine.
In my case issue was with H256 HEVC videos, but in your case some other encoding / tagging issues can be the reason.
In my case, issue was fixed with ffmpeg:
ffmpeg -i input.mp4 -tag:v hvc1 -acodec copy -c:v copy -movflags faststart out.mp4

Making HTML5 app available offline

I am working on an HTML app for a client. The entire app front end is done with 1 HTML file, 1 Javascript file, 1 CSS file (plus jquery) and a few images. There are a few php scripts sitting on the server, which are called using AJAX, but only if an internet connection is available. If no connection is available, then the site will use locally cached data (using localStorage).
To make the site available offline, I'm declaring the cache manifest in my HTML. My HTML looks like this:
<!DOCTYPE html>
<html manifest="cache.manifest.php" language="en">
...
</html>
The cache.manifest.php's output look like this:
CACHE MANIFEST
#VersionHash: 80b9345e6c39efbbe8431e394b014b4f
CACHE:
/css/ebot.css
/favicon.ico
/images/appicon.png
/images/list-arrow.png
/images/list-checkmark.png
/images/woman.png
/index.html
/js/jquery-1.8.3.min.js
/js/ebot.ls.js
NETWORK:
/emaillog.php
/getdata.php
/uploadlog.php
So far so good. Now, I access the site from a browser with the internet connection available. I get a little notification asking whether to allow the site to store information for offline use - I allow it. When I check in settings, I see that the site stores 316K of data - about right.
Now I turn off internet connection and attempt to access http://www.mysite.com/index.html - and get an error message saying "Internet connection not available" (or something to that extent) and the page is not displayed. This is happening in 3 browsers I tested on my dev machine (firefox, safari and chrome) as well as on the client's ipad (the app is eventually for consumption on an ipad).
What am I missing here? What am I doing wrong?
There could be many reasons for this.
Take a look at this articles:
http://www.fuckyeahtml5.com/2011/06/debugging-html5s-offline-web-apps
http://appcachefacts.info/
http://diveintohtml5.info/offline.html
https://developer.mozilla.org/en/docs/HTML/Using_the_application_cache
I guess that you didn't specify proper content type (MIME) for your manifest. It shoud be 'text/cache-manifest'.
Check events in console in Chrome. You should see something like this when appcache manifest is correct:
Creating Application Cache with manifest http://example.com/manifest.appcache
Application Cache Checking event
Application Cache Downloading event
Application Cache Progress event (YYY of XXX)
Application Cache Cached event
I would suggest to start from the simplest manifest to make sure that manifest is parsed. Try:
CACHE MANIFEST
NETWORK:
*
such manifest should cache only your start html page.

error with Google+ button Badge

I want to use this button on my page but when I use chrome script appears to create a new circle, the same happens in firefox and safari explorer only works on analyzing with the console I get this error
Failed to load resource: the server responded with a status of 400 (Bad Request) /+1/fastbutton?bsv&annotation=inline&width=300&hl=en-US&origin=file%3A%2F%2F&url=file%3A%2F%2F%2FC%3A%2FUsers%2Fusuario%2FDesktop%2Fnoche.html&jsh=m%3B%2F%2Fapps-static%2F_%2Fjs%2Fgapi%2F_features_%2Frt%3Dj%2Fver%3DlgJnpFHo_sE.es.%2Fsv%3D1%2Fam%3D!9YrXPIrxx2-ITyEIjA%2Fd%3D1%2Frs%3DAItRSTMUGsaYaMyYb_qFDQo8MG8RKB82aQ#_methods=onPlusOne%2C_ready%2C_close%2C_open%2C_resizeMe%2C_renderstart%2Concircled%2Conload&id=I1_1352910400423&parent=file%3A%2F%2F">https://plusone.google.com//+1/fastbutton?bsv&annotation=inline&width=300&hl=en-US&origin=file%3A%2F%2F&url=file%3A%2F%2F%2FC%3A%2FUsers%2Fusuario%2FDesktop%2Fnoche.html&jsh=m%3B%2F%2Fapps-static%2F_%2Fjs%2Fgapi%2F_features_%2Frt%3Dj%2Fver%3DlgJnpFHo_sE.es.%2Fsv%3D1%2Fam%3D!9YrXPIrxx2-ITyEIjA%2Fd%3D1%2Frs%3DAItRSTMUGsaYaMyYb_qFDQo8MG8RKB82aQ#_methods=onPlusOne%2C_ready%2C_close%2C_open%2C_resizeMe%2C_renderstart%2Concircled%2Conload&id=I1_1352910400423&parent=file%3A%2F%2F
I believe the problem is that you are testing this code locally served through the file:// protocol as shown in the query parameter:
origin=file%3A%2F%2F&url=file%3A%2F%2F%2FC%3A%2FUsers%2Fusuario%2FDesktop%2Fnoche.html
Place your file in a location that can be served through http. Upload the page to your site or install a web server to test on.
I believe I was able to duplicate what you saw in Chrome and Safari; however, this approach is not a supported method to use the plugin and wouldn't be used to serve the page to real users.

Offline app in asp.net

I am trying create an app which has offline features. The manifest file that I have created looks like this-
CACHE MANIFEST
# version 1.0.0
CACHE:
/ShareBill.Web-Offline/
/ShareBill.Web-Offline/Groups
/ShareBill.Web-Offline/Content/Site.css
/ShareBill.Web-Offline/Content/jquery-ui.css
/ShareBill.Web-Offline/Scripts/ShareBill.js
/ShareBill.Web-Offline/Scripts/lib/jquery-1.7.2.min.js
/ShareBill.Web-Offline/Scripts/lib/jquery-ui.min.js
/ShareBill.Web-Offline/Scripts/TransactionsIndex.js
/ShareBill.Web-Offline/Content/Images/ajax-loader.gif
/ShareBill.Web-Offline/Content/Images/br_down_icon.png
NETWORK:
/ShareBill.Web-Offline/Transactions/Filters
What I expect is when I view this url /ShareBill.Web-Offline/Groups. My browser should not make any requests to the server else the whole purpose of being offline would be void.
But as I can observe using fiddler is that, the browser makes a request for the manifest file every time i refresh the page. I made sure that I see the cached resources in the Chrome dev tools.
Now when I turn my IIS off and make a request like this, I end making my AppCache status as OBSOLETE. Then on the very next page refresh, I get a 404 response. Am I missing something in terms of implementation?
I applied the Expires header to request that was asking for the Manifest file. And that worked :)