Cannot get cookies in WebBrowser in windows phone 8? - windows-phone-8

In my windows phone appliation, i'm using Web Browser. And my xaml code for the web browser is,
<phone:WebBrowser IsScriptEnabled="True" Navigating="NAvigating" Navigated="Uri_Navigated" x:Name="browserControl" Margin="-1,55,0,0" />
When i get cookies from Uri_Navigated function everything works fine, but when i try to get the cookies from NAvigating function,when i execute the code,
cookies = browserControl.GetCookies();
I get an exception stating that,
An exception of type 'System.InvalidOperationException' occurred in Microsoft.Phone.Interop.ni.dll but was not handled in user code
What is the problem? how should i get the cookies in NAvigating function??

The exception that is thrown when a method call is invalid for the
object's current state.
I guess this is by design. It won't give you the existing cookies because they are already stale and it won't give you the new cookies because they are not created yet.

Related

WebAssembly crash info in window.onerror()

I am trying to collect crash logs for my WebAssembly application. It's built with emscripten, everything is served from the same domain, testing in Chrome. In the developer console I see a proper error with stack trace when a crash occurs, I'd like to capture this and send it to a server.
Instead I am only getting "Script error." passed to window.onerror() and the fifth parameter is null. This is supposed to happen when violating the same-origin policy (linked question is only about javascript, does not talk about this WebAssembly-specific problem.) Errors occurring in the .js file don't have this problem, only webassembly runtime errors.
I added the crossorigin attribute to the .js file generated by emscripten. The site is running in secure context, the Response object passed to WebAssembly.instantiateStreaming() (in the emscripten-generated .js file) has "basic" as its .type, so as I understand it has no restrictions on what can be done with it. "Access-Control-Allow-Origin" header is set to "*".
For some weird reason I managed to get the full error with stack trace exactly once, so it is apparently possible, but seemingly doing everything the same way I can't get it to work again.
How can this be solved?
instantiateStreaming is promised based so maybe try window.addEventListener('unhandledrejection')?

Handle FileNotFoundException thrown by ImageResizer.AzureReader2 (BlobNotFound)

I'm running an MVC app on Azure. I use the AzureReader2 plugin. It's been working fine for years.
But when this hits missing images, it throws FileNotFoundException exception and this apparently breaks down user authentication, causing user to be redirected to login page.
Is there a way to prevent this? How can I catch and handle this exception for the URL API?
I am considering the Image404 plugin. But I am not sure it works with AzureReader2 plugin (?)
Exception handling would be best for me as I could take some other actions.
Thanks
You can see the Image404 plugin source code on GitHub. There is a Config.Current.Pipeline.ImageMissing event that it handles - you can plug into the same event to do your own logic.
It should work fine with AzureReader2.
Note that most likely your 404 page is set to require authentication, which is why it is redirecting.

JS error on Chrome (with Device Toolbar enable)

When I turn on the tablet mode or the phone mode in Chrome, I get a javascript error :
Uncaught TypeError: Failed to execute 'elementFromPoint' on 'Document': The provided double value is non-finite.
at HTMLHtmlElement.avp.disableTouchSafari (viewer3D.min.js:18)
I've just update Chrome to the last version.
Any idea?
This might an issue of Forge Viewer. Apologizing for any inconvenience caused.
I have logged a request LMV-3401 [Autodesk.Viewing.Private.disableTouchSafari() reports error while viewing model with Chrome DevTools' Device Mode in macOS] to our development team to allocate time to investigate. As it requires further exploration and possibly a modification to our Viewer, please make a note of this number for future reference.
You are welcome to request an update on the status of this request or to provide additional information on it at any time quoting this request number via forge.help#autodesk.com.
However, I think this error didn't affect main features of Viewer. At the meanwhile, I think a real mobile device will help you in this case since this error didn't show up while testing on my Ipad.
Cheers,

Chromecast sender: session error when requesting new session

I've started getting this issue with my Chromecast sender app after I accidentally shut down Chrome while the receiver was still running on the Chromecast device.
Whenever I try to start the receiver, I immediately get a session error. The receiver starts, but it doesn't get any data from the sender, obviously.
The cast menu in Chrome indicates that it's casting. If I click Stop, the receiver app will close but the funny thing is that the cast menu still indicates that it's casting. If I click Stop again it will no longer show as casting.
The same thing happens every time I try to cast. I've tried restarting both the Chrome browser and the Chromecast device several times with no luck.
The error object passed to the error handler provides no details.
Anyone now what's up and how I can get it sorted out?
Thanks!
I got stuck into this problem as well. The error message that gets thrown is not that informative. For me, the problem was that I tried to cast a file located at my localhost server. Google seems to have blocked all files coming from either localhost or any 192.168.X.X IP address.
So, try with an external file and make sure you have the correct CORS headers set for your file server (Content-Type, Accept-Encoding and Range): https://developers.google.com/cast/docs/chrome_sender_advanced#cors_requirements

Flash UrlLoader - prevent or suppress authentication dialog box

I have a rssfeed application made in Adobe AIR. It uses the UrlLoader to read the feeds. I need the application to never prompt the user to enter password for a website or accept a certificate of a website if is no longer valid. I prefer to have it fail instead.
I have setup the event listeners for IO+Error and Security_ERROR but that is not enough
Sample urls(this may not work in future)
http://www.dawnanddrew.com/rss2.xml (asks for user and pass atm)
I had another issue with a feed that even if it was a http url the website redirected the loader to https and then the certificate validation failed and the user was asked to accept the certificate. I need this to fail (I mark failed feeds and the user can check them when they want to find the issue and fix them or remove them)
Using AIR (which you are), you can actually tell the application to NOT handle authentication.
var request:URLRequest =new URLRequest("http://www.dawnanddrew.com/rss2.xml");
request.authenticate = false; //default is true, so you need to tell your request to not handle authentication
Then it will fail with an IO error instead of prompting for credentials.
Documentation
Note however, this will only work in AIR and is not a supported property for flash player.
You cannot do it this way. Now, the server returns specific status and the browser reacts to it by showing you a login dialog box. You cannot do this directly in flash and you cannot get default login button. You need to implement this by your own. The perfect way to do so is to check (server side) if the user is logged in and if not - return status ok (200) with an error message (let's say JSON). This specific message would be read by the flash client and a login screen would be shown (custom made). You will also need to implement the login feature by yourself :)
Sorry for the bad news, but this is the way it is with flash.