VS 2013 WPF WebBrowser Enable Javascript - javascript

I'm trying to make a custom browser with some buttons to instantly switch to the websites I visit most often and have click button logins etc. (ease of access)
wb.Navigate("http://www.________.com");
So the problem is when I get on the website I have some script errors pop up, I have activex to silent them but when it logs in as the website proccesses my login request it comes back with "You need javascript enabled".
Now I have read a lot and the only things that seem to be relevant was to change the registry for the program or to relax my internet options both which have failed and all the other information is from like 2007 which references are no longer available.
Any ideas how to wb.IsScriptsEnabled = true;?

After spending all day on this I discovered there is
HKEY_LOCAL_MACHINE (or HKEY_CURRENT_USER)
SOFTWARE
Microsoft
Internet Explorer
Main
FeatureControl
FEATURE_BROWSER_EMULATION
yourapp.exe = (DWORD) version
Nobody has mentioned (HKEY_CURRENT_USER) So I tried it and it appears to be working now. Will update if not so.

Related

Facebook SDK FB.GetLoginStatus Load denied by X-Frame-Options (Firefox Only)

I have this web application login page that calls FB.GetLoginStatus() from the Facebook JavaScript SDK after the document is done loading. This worked perfectly fine on all browsers (mobile included) and that was the happily ever after.
BUT, one day, out of plain nowhere, I notice that the SDK is failing to get the login status data of the Facebook user when the page is done loading. I take a look in the console and I see something around the lines of
Load denied by X-Frame-Options [massive link generated by the SDK]
does not permit framing.
Here's what bugs me: this works perfectly fine in Safari. I was introduced to the error when I opened the web app on Chrome (same error as quoted above, slightly different wording). I tried on Firefox and got the same thing. I spent a few hours trying to find a cause but failed and went to sleep.
I wake up the next day and miraculously it's now working on Chrome (?) without me having done any changes (?!). But, for some reason, the error persists only in Firefox now.
Does anyone have a clue what this might be? Something that Firefox does differently that Safari and Chrome don't?
A clue here is that I'm using a tunneling service (ngrok) and I don't have a signed certificate for it, thus I get the casual (you're entering an 'unsafe' website, blah blah blah). Perhaps Firefox is blocking the SDK because the connection is not secure?
Any insight on this would be marvelous. Thanks 🙂
OK, after fighting this for a few hours I finally found out what was bothering Firefox: the website site URL field in the app's Facebook Dashboard settings.
The issue wasn't even with ngrok or a missing signed certificate, it was the fact that the website in the settings had the production domain (.app) instead of the ngrok one I'm currently using for development (eu.ngrok.io).
The only reason I managed to pinpoint this back to the dashboard settings is because I have 2 Facebook apps, and the other one was working fine, so I imagined it might be a misconfiguration in the settings that was causing the issue (Facebook has a shitty standard in place for explaining/handling errors — it's like shooting in the dark until you hit something when using their SDK's).
What I don't understand here is why the heck only Firefox seems to have a problem with this setting being misconfigured or why the issue disappeared out of nowhere from one day to the next for Chrome. Anyways, if I managed to help anyone else fix anything similar with this thread than this headache has been worthwhile.
Peace out ✌🏽

Skype CDN over SSL

I used to test whether a logged-in user could hit the Skype CDN to determine whether or not to show them UI elements:
https://cdn.dev.skype.com/uri/skype-uri.js
But it seems like, out of nowhere, their CDN just moved (breaking my code) to here:
http://www.skypeassets.com/i/scom/js/skype-uri.js
My page is https and I can change the url above to https a la:
https://www.skypeassets.com/i/scom/js/skype-uri.js
But because there is no valid certificate there I can't connect and the browser doesn't throw the "confirm security exception" message.
What are my options to determine if I can connect to Skype CDN from SSL?
They were made aware of it by a developer here over a month ago.
To sum it up:
They are now aware of the problem.
They're deploying a fix shortly.
It might still cause issues with Chrome.
Seems like you'll just have to hang tight, sorry.
Here is their full official response:
Hi,
Thanks for posting, URIs are supported by the Skype Developer team and you can find out how to contact us by visiting the contact us page on http://developer.skype.com.
I can confirm that using Skype URIs on secure connections is presently broken. We have identified a fix and hope to deploy it shortly. Its likely, however, that the fix will still not work on newer versions of the chrome browser due to a change in the way it handles iframes launched over secure connections.
Allen Smith
Skype Developer Support
Update
7 months later and they still haven't properly fixed it.
However, that same thread now has a solution (of sorts) in its last comment:
Copy skype-ui.js to your project and replace below code to:
this.SkypeClientDownloadUrl = this.httpProtocol +
"//secure.skype.com/download"; this.assetPrefix = this.httpProtocol +
"//secure.skypeassets.com/i/scom/images/skype-buttons/";
this.analyzeScript = this.httpProtocol +
"//secure.skypeassets.com/i/scom/js/" + "skype-analytics.js";
Not pretty by any means, but at least it seems to work.

Is it possible to Blink alert "client browser" when new notification came in JSF?

I am working on JSF with primefaces, i have been assigned a task to notify the browser when new message arrived in client desktop, its like Message alert.
I found some concepts p:poll, and p:notificationBar, p:growl but those are happeniing inside the browser window itself, when browser is minimized the user can't get notify the new message arrival.
My question is:
Is it possible to do it in JSF with the help of Javascript?
I don't know whether it is possible to notify to the client?
How can i enable notifications for window minimised state as well?
You can make the title bar flash and on some platforms, even get the user's attention.
Make browser window blink in task Bar
Possible to flash a Browser window using Javascript?
This question shows part of your possible answer.
You should then use a to watch for the notification change. You could use the push framework, but that could be a bit of overkill on the network / connectivity side.
There are some solutions that work for only specific browsers. If you are doing this for your company intranet environment and everyone uses chrome or IE, there might be better solutions. Nonetheless, you should strive to do something that works on all compliant browsers (w3c compliant, that is).
There are some boundaries you should observe, regarding web apps in browser windows and what is the expected behavior. The user expects a minimized / offline browser window to sit quiet. If you are in a corporate environment, this could be waived, but for an app for the general public on the web, some people could (I would) be annoyed by this attention-seeking behavior (on a browser game, for example).

Unable to allow IE10 to run scripts

My IE10 has stopped execution of JavaScript for pages stored locally, infact it does not asks for permission to allow their execution.
I have Windows 8 x64 with IE 10 installed. A few days back whenever I used to open a file which used JavaScript IE10 used to display a message "IE restricted this webpage from running scripts or activex controls" with a button to allow blocked content.
Now, this dialog doesn't appear at all and I'm unable to test JavaScript programs in my local machine using IE. (On websites like gmail etc JS simply works).
I have tried changing security setting inside internet options to lowest but no use.
P.S.: On repeatedly clicking reload on realized that permission to allow blocked context dialog appears for fraction of a second and disappears.
I solved the issue by installing a cumulative security update for IE10 Windows 8 x64 from
this link
Don't know why this is related with the issue, but my friend suggested me try to update IE, and on googling I found this update.
I posted it here because when I searched internet for the solution, I was not able to find any case of this type.

Full page reload of a Facebook app with IE, but not with Chrome

I've developed a Facebook application using the Facebook C# SDK. Interestingly, whenever the user clicks on a link in Internet Explorer, the whole page reloads - including the friends list on the right and the chat list. If one does the same with Chrome, this doesn't happen - only the canvas page gets reloaded, but the lists on the right remain untouched.
I traced the problem using the Fiddler Web Debugger and found the following. Assume my application is called my_app, and it is deployed on Windows Azure (cloudapp.net). Thus, a click on a link (to the same page, for instance) in IE results in the following calls:
my_app.cloudapp.net/Default.aspx
www.facebook.com/dialog/oauth/...
www.facebook.com/dialog/permissions/...
cloudapp/facebookredirect.axd?state=...
apps.facebook.com/my_app/...
my_app.cloudapp.net/Default.aspx
The backtrace from Chrome is completely different:
my_app.cloudapp.net/Default.aspx
www.facebook.com/extern/login_status.php?...
For some reason the authorization process from Chrome is different. I implement the authorization as it is done in the sample files from the Facebook C# SDK - using CanvasAuthorizer.Authorize(). Any ideas why this problem occurs and do you have any recommendations on how to get the Chrome behavior on IE?
Many Thanks,
Yordan
I would bet it's a cookie issue. IE can act odd with cookies in iFrames (which is likely why its reauthenticating with every request).
I don't know about that SDK, but try adding something like this to your code behind master page - this is a P3P privacy policy that might help.
HttpContext.Current.Response.AddHeader("p3p", "CP=\"IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\"");

Categories