Is there a way to open URL in default OS browser?
I have MenuItem and want to open certain URL whenever user clicks this item:
var item = new gui.MenuItem({
label: 'Shortcut',
click: function(){
//here i want OS to open some URL
}
});
You can proceed like that:
gui.Shell.openExternal("http://website.com")
See the documentation here: https://github.com/rogerwang/node-webkit/wiki/Shell
See also How to open a browser window from a node-webkit app? for more informations.
Related
I'm testing my website using Laravel Dusk and I want to test a link that open a new tab to check if it goes to the correct URL. My test looks like this;
$this->browse(function (Browser $browser) {
$browser->loginAs(User::find(1))
->visit('/test')
->waitForLocation('/test')
->click('#test-link');
$window = collect($browser->driver->getWindowHandles())->last();
$browser->driver->switchTo()->window($window);
$url = $browser->driver->getCurrentURL();
Assert::assertTrue($url == 'http://foobar.com');
});
The problem here is that the URL that I'm getting is just about:blank. At first, I thought it's because the new tab is still loading but I tried to add a pause(5000) before getting current URL but it still returns about:blank. Why does the new tab doesn't proceed with the URL of the link?
Why is google reCaptcha2 (gReCaptcha) not showing after a page refresh, but showing if page is reopened by the link?
See this video for explanation: http://take.ms/I2a9Z
Page url: https://orlov.io/signup
Page first open: captcha exists.
Navigate by link: captcha exists.
Open new browser tab: captcha exists.
Refreshing page by refresh icon, ctrl+R, ctrl+F5: captcha NOT exists.
I added body unload event to prevent browser cache, it did not help.
Browsers for testing:
Firefix 39.0
Chome: 44.0.2403.125 m
Opera: 30.0
In all browsers I get the same result. So does this mean there's an error on my side?
I think it has to do with the browser and the speed of your network. You are calling ReCaptcha with a callback, but you call it before you define the callback. Depending on your network speed or browser quirks, it might execute before the rest of the script has loaded.
Line 330:
<script src="//www.google.com/recaptcha/api.js?onload=renderReCaptchaCallback&render=explicit&hl=en-US" async defer></script>
Line 351:
<script type="text/javascript">if (typeof (renderReCaptchaCallback) === "undefined") {
var reCaptchaWidgets = {};
var renderReCaptchaCallback = function() {
jQuery.each(reCaptchaWidgets, function(widgetId, widgetOptions) {
grecaptcha.render(document.getElementById(widgetId), widgetOptions);
});
};
}</script>
So I would move the definition of renderReCaptchaCallback to the top of the page so it is defined well before trying to load it.
I have URL of PDF file and want to open within the application so that i can navigate back to application. I don't want to go to browser. Can anyone help?
Check this out:
iOS:
http://docs.appcelerator.com/titanium/3.0/#!/api/Titanium.UI.iOS.DocumentViewer
Android
http://developer.appcelerator.com/question/72361/open-pdf-file-on-android
Or you could try and show it in a webview:
var pdfViewer = Ti.UI.createWebView({
url: "url.pdf",
width:1000,
height:1000
});
I am currently working on a project in titanium .I wish to open url in default browser of BB10
simulator instead of webview used in the app on click event .I am using the following code
var win =Ti.UI.createWindow({
title:'Test'
});
var webview=Ti.UI.createWebView({
url:"http://demo.php.otssolutions.com/videoapp-uat/home"
});
win.add(webview);
webview.addEventListener('click',function(e){
var url=e.url;
Ti.API.info(url);
Titanium.Platform.openURL("http://demo.php.otssolutions.com/videoapp-uat/home");
});
win.open();
Thanks in advance for any help
I have a hybrid mobile app built on Trigger.io that opens links (some of them are user generated content) in the in-app child browser (forge.tabs module) per default. When trying to open a .pdf document the screen will stay blank white (tested on both Android and iOS).
Here is a cut down version of the code I'm using:
$(document).on('click', 'a', function() {
window.forge.tabs.open( $(this).attr('href') );
return false;
});
I would expect to either view the document in the in-app browser or be able to download it to the device.
Assuming your PDFs are local, you'll need to do a "getURL" first.
Here's a function that works just fine for me:
function showPDF (pdfName) {
forge.tools.getURL(pdfName, function (myPDF ) { forge.tabs.open(myPDF); });
}
Then just call showPDF with a relative or absolute url i.e.
<button class="btn" type="button" onclick="showPDF('assets/pdf/sample.pdf');">