Need to open link in IE from FIREFOX - javascript

I have developed application in mvc 5 from where I need to open next web application from link which runs only in IE < 9 ;but my application runs in firefox and is NOT supported in IE < 9. So I managed to open the application from Process.Start("IExplore.exe", http); which works fine in debug but while application is hosted it doesn't work. So I need a solution to open application from firefox in IE using backend c# code or javascript.

You can use the below
Process p = new Process();
p.StartInfo.FileName = "iexplore.exe";
p.StartInfo.Arguments = "http:\\\\www.google.com";
p.Start();
This will open Internet Explorer, and immediately load the website passed in as an argument.
Also, the Process class is part of the System.Diagnostics namespace. Be sure to reference it at the top of your code file.
if you are using windows 8 or higher then you can use
System.Diagnostics.Process.Start("IEXPLORE.EXE", MyURLHere)

Related

Selenium-webdrivers firefox ubuntu activate javascript

I have some issue with selenium-webdrivers on Ubuntu. Everything is working fine instead firefox has no javascript activated. When I open a website that requires javascript it pop the noscipt error. So the website is displaying <noscript>Javascript is required ....
Is there a function to enable JS on Firefox on Ubuntu or das this is a selenium failure and I need to set a driver.
Code:
require 'rubygems'
require 'headless'
require 'selenium-webdriver'
#headless = Headless.new
#headless.start
#driver = Selenium::WebDriver.for :firefox
#driver.navigate.to 'URL'
... actions
#headless.destroy
The Website navigate over HTTP:Headers and Ajax I think.
If someone have an idea I would be thankful.
On dev machine (win 10) all working fine.
Regards
Mat
EDIT
With recent modules you need firefox 65+, because firefox 65+ has his own headless module. Now everything is working fine and fast. Also need recent Geckodriver. Poorly not working with old firefox versions.
Refer comment here...
An alternative is to install a Firefox addon that disables JavaScript. This worked for me with Firefox 45 ESR, selenium-webdriver (2.53.4), and capybara (2.8.1):
profile.add_extension(File.expand_path('../quickjava-2.1.0-fx.xpi', FILE))
Configure the extension to disable JavaScript by default.
profile['extensions.thatoneguydotnet.QuickJava.startupStatus.JavaScript'] = 2
Disable loading the extension's first-run tab.
profile['extensions.thatoneguydotnet.QuickJava.curVersion'] = '2.1.0'
Reference : Disabling JavaScript when using Capybara + Selenium

How to use QAxWidget browser to open url with WebGl content

I'm using QT 5.8 and trying to load webpage using QAxWidget (set to IE) that displays HTML 5 empty canvas.
QString url = "https://h3manth.com/demo/canvas/full-page.html";
ui.browser->dynamicCall("Navigate(const QString&)", url);
Running the same url directly in IE works fine.
But when running it from my simple QT application I'm getting script error:
And getting the blank view as a result even when pressing 'Yes' in the dialog.
Any ideas for possible solution?
Modifying the reg keys as described on msdn: msdn.microsoft.com/en-us/library/ee330730(v=vs.85).asp ensures using the intended IE version for "embedded" browser

Sending Data from a UIWebView back to an iOS Application with a custom URL Scheme breaks with Xcode 8/iOS 10

On iOS versions previous to 10, I was able to send information from the JavaScript/HTML loaded into a UIWebView back to my application by creating an iFrame on the document or setting document.location.href to a custom URL which the web view would tried to load:
<html>
<body><input id="clickMe" type="button" value="clickme" onclick="changeWindow();" /></body>
<script type="text/javascript">
function changeWindow() {
//create temp frame
iFrame = this.createIFrame('onStatusChange://eyJ1c2VyTmFtZSI6IkpBTCIsLCJwcm92aWRlciI6IkVtYWlsIn0=');
//remove the frame now
iFrame.parentNode.removeChild(iFrame);
}
function createIFrame(src) {
var rootElm = document.documentElement;
var newFrameElm = document.createElement('IFRAME');
newFrameElm.setAttribute('src', src);
rootElm.appendChild(newFrameElm);
return newFrameElm;
}
</script>
</html>
Then on the client, I would just listen for the UIWebViewDelegate callback webView:shouldStartLoadWithRequest:navigationType:, and check to see if the request.URL.scheme was equal to my custom scheme (in this case onStatusChange).
This is a popular way of communicating between the JavaScript and an iOS app, as seen in popular questions such as How to invoke Objective C method from Javascript and send back data to Javascript in iOS?.
This works on any app built with Xcode 7 (Objective-C or Swift) on iOS 9 and 10 devices. I'm running into an issue where the delegate method is not called on any applications built with Xcode 8. It's as if the web view isn't even trying to load the URL, which in turn is not triggering the delegate callback.
Were there any changes to UIWebView or WebKit from Xcode 7 to 8 or iOS 9 to 10 which would cause this not to work? What's really puzzling to me is that a production app I have built with Objective-C in Xcode 7 targeting iOS 8 works on an iOS 10 device, but a debug build built with Xcode 8 of the exact same codebase does not work.
Ok, long story short we use a special URL scheme onStatusChange:// to send Base64 encoded data from the web view back to our iOS application. I believe UIWebView on iOS 10 chokes when trying to load a URL that ends in one or more equals sign characters, and loads about:blank instead of the actual URL.
Since this works perfectly on iOS 9, I'm assuming this is a defect with iOS 10 and have opened rdar://29035522. A full reproducible example of the issue is available in the body of that radar.
I am reading through the Base-N encoding RFC to determine if it is acceptable to remove the padding = characters at the end of my data string, or if they need to be removed from the web and added on the client before decoding the data.
The solution I ended up implementing was percent-escaping the Base64 encoded data, and unescaping it on the client. Not the most elegant solution, but probably the best for safety.
Thats because iOS now blocks http requests by default. You have to reenable it in your info.plist.
https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html#//apple_ref/doc/uid/TP40009251-SW33

window.open returns null on windows phone 8

I am currently working on a hyrbid mobile app for windows phone 8.0 and windows phone 8.1 using the cordova framework. There is a scenario where I need to use the in-app browser to launch a login page.
I used the following javascript code .
var authWindow = window.open('http://www.mylogin.com', 'mywindow', 'location=yes,toolbar=yes,clearsessioncache=yes');
Although the window opens fine I am getting null as the reference to the window object here. I need the reference to perform other actions on the opened window.
On further research I found that issue exists in desktop IE11 also and we have to disable the protected mode. Once I did it and ran the code on desktop IE11 it worked fine.
I am not sure how to achieve the same in my scenario. Is there any setting I need to change on the browser control? How do you resolve this?
Open external pages on Windows Phone as a Javascript Mobile App is a real problem. On Android and IOS you just use "windows.open" and you are good to go. But on WP, we will need to create a C# plugin.
On my app, I did the following:
1 - You will need a javascript function that calls the plugin.
Javascript call
function openExternalURL(theURL) {
cordova.exec(function () { }, function () { }, "yourApp.main.plugins.YourPluginClass", "openURLWithNative", [theURL);
};
2 - Now you need to implement a C# class that calls Windows Phone browser with the correct URL. For it, you should create a .cs file (in the example its name is YourPluginClass.cs):
YourPluginClass.cs (C#)
namespace yourApp.main.plugins
{
class YourPluginClass : BaseCommand
{
public void openURLWithNative(string uri)
{
WebBrowserTask task = new WebBrowserTask();
string optVal = JsonHelper.Deserialize<string[]>(uri)[0];
task.Uri = new Uri(optVal);
task.Show();
}
}
}
This way, you can open any external URL on Windows Phone like Android and IOS.
Hope it helps. Best Regards!
There is a few good workaroungs that worked for me in :
Do a window.open("about:blank", "newPage"); before the AJAX call and then after the call add the URL to the opened window by calling window.open("http://google.com", "newPage");.

javascript/jquery, CSS not working properly on IIS hosted site

The JSON script below is working fine on my development machine.
Now, I have hosted this MVC ASP.NET site on IIS 7.5 on Windows Server 2008 R2.
It shows many 'CSS not working' (specifically for JQGRID). Also it shows the ERROR below.
I also faced one error on line - console.log('executed');. I removed this line and it stopped at the JSON below.
var f = JSON.stringify({
's': values, 'da': $('input[name=Days]').val(), 'date': $('#date').val(),
'tv': $('#tv').html(), 'classCode': $('#ClassCodeValue').html(), 'section': $('#Sec').html(),
'we': $('#We').html(), 'attendType': $('#AttendTypeValue').html(),
'adClass': $('#adClass').val(),
'variousLen': variousLen,
'varDHour': varDHour,
'varDMin': varDMin
});
It is all working fine on development machine Windows 7 Professional.
I have given access to script folder and it looks like, jquery is working as it reach to this page on the website. but some of script or css not working properly as above issues.
Please suggest me what is wrong here.
I have been usin: IE 8 and IE 11.
It was weired issue. Actually, when i open hosted site on IE then site's mode is automatically set to compatibiity mode instead of standard mode. when i set its mode manually to standard mode then no such issue.
i have added expliciltiy : as firlst line of HEAD element.
Now, it works fine.. but it sets compaibitly view mode though most of the all issues are resolved.
but some issue arise for jqgrid header CSS. if set standard mode then it works fine.
If there is any way/suggestion to set on standard mode then it is best...exa- if browse has - IE9, IE9 comaptbility mode then above meta tag sets its mode to highest mode of that browser that goes to compabitlity mode.
I am using itranet application.
Thanks

Categories