window.open on Windows Phone 7 - javascript

I am looking for any information, or help with an issue I am having with Mobile IE9 on Windows Phone 7 Mango; although I would settle for a resolution on Windows Phone 7 in general.
<input type="button" value="input" onclick="window.open('http://www.google.com')" />
<span onclick="window.open('http://www.google.com')">span</span>
anchor
I am using this.
http://jsfiddle.net/ag7wU/1/embedded/result/
When I select any of these elements on the Windows Phone 7.0/7.1, I navigate to google.com. On every other browser I can readily find, a new window/tab is created: Chrome, Firefox 6.0, Opera 11.50, IE9, Safari, WebKit on BB OSv6, Dolphin on Android 2.3.3, Dolphin on android 3.2, and mobile safari on the IPhone and IPad.
The only exception is windows phone 7. The best solution I can find is to use the anchor tag and href attribute, and instruct users that they are going to have to hold down the links they want, and select "open in new tab" Am I missing something?

You should always provide a fallback for environments that do not support multiple tabs and windows (or JavaScript).
You want to make sure that the browser can display a real URL when the user hovers over the link, and that the link is long-press/right-click copyable.
You also want to preserve link URLs for indexers, link checkers, offline archivers like archive.org, and other robots.
anchor

Related

Is it possible to open a new URL in Safari from Chrome if the page is being viewed on an iOS device?

Let’s say I have a webpage and it has a button with an HREF attribute. I want the HREF of that button to be opened on Safari browser if the button is being clicked from an iOS device, even if the user is accessing the page on Google Chrome.
As of now, I only need to handle this situation for Chrome and not any generic browser. The way I see it, there are two parts to the problem:
Identifying the OS of the Client Machine: This I might be able to do easily.
Opening the Popup on Safari from Chrome: This is the tricky part I am not sure if it is possible.
I am looking for possibilities of accomplishing the second part.
Short Answer: no.
Long Answer: Some iOS apps have defined URL schemes that can be used to access the app directly from the browser. For example, twitter://timeline. But Safari for iOS does not have one.
You can detect the OS the user is using and if it Chrome then suggest the user to open it in Safari and also provide the link where to download it from. Or you can also suggest the user to make safari their default browser. ( Also provide a link on how to do that to them).

How to force Opera Mini users to view my website from other browsers on their phones?

I run a couple of blogs and I do not want my sites to be viewed from a Opera Mini mobile browser. I want to force my links to open on other browsers present on their devices other than Opera Mini. Basically, when my link gets clicked on by Opera Mini users, I want my site to open on other browsers present.
I have tried all I could but to no avail. I shall appreciate every help I can get over this.
You can check the USER AGENT of Opera Mini and show a message to the users.... but you can't open automatically another app from browser website, there are security restrictions.
Here you can find the useragent string for Opera Mini: http://www.useragentstring.com/pages/Opera%20Mini/
Here a good answer for check the user agente via javascript: Getting the User Agent with JavaScript

Linking to iOS Safari's Share Menu

I'm helping to build a webpage that is mobile friendly. We are currently in beta and using the "Add to Homescreen" function of Safari on iOS to make the webpage appear as an app. Is there a way through javascript or html to code a link to Safari's share menu? We want to be able to access this share menu from the bookmark shortcut rather than having to be in the actual Safari browser on the phone.
This is an old question, but as of iOS Safari 12.2 and macOS Safari 12.1, Safari supports Navigator.share() to display the system share menu.
The Share menu in Safari is a component of the browser, not the web page. It cannot be linked to.
If you want your users to activate the "Add to Homescreen" function of Safari, you will need to instruct them to press the Share button themselves.

Cannot discover ipad in Develop menu in Mac Safari

I need to debug a Javascript on iPad Safari (iOS-6). I guess this can be done using remote debugging by connecting it to the Mac (or using a xCode iPad or iPhone simulator instead of connecting an actual iPad). I also need to turn on Safari->Advanced->WebInspector on the iPad and Safari->Preferences-> Advanced ->check the "show Develop menu in the menu bar" option in my macbook. And then when the Develop option appears in the top Safari toolbar (I dont know the exact terminology for this) I should be seeing my iPad there and then can start remote debugging. Now everything is fine except the fact that I cant see the ipad (or the simulator as I tried both option) in the Develop option in Safari. Any ideas/thought what am I missing here?
You must have at least Safari 6+
Looks like you can't on Windows unless you're doing some form of emulation--
http://developer.apple.com/library/ios/#DOCUMENTATION/AppleApplications/Reference/SafariWebContent/DebuggingSafarioniPhoneContent/DebuggingSafarioniPhoneContent.html
"Important: You can only inspect apps on devices that have been transferred to your device from Xcode. You cannot inspect apps that have been downloaded from the App Store, even if it is your app."
You also need OSX 10.7 and safari 6, which doesn't exist for windows yet. :(

adding bookmark to mobile browser using javascript

There exist javascript APIs for adding bookmarks to browser using javascript, but it works only on Desktop
Firefox
window.sidebar.addPanel(location.href,document.title,"");
IE
window.external.AddFavorite(location.href,document.title);
http://www.hostingfanatic.com/webdev/add-to-bookmarks-javascript/
The above site hosts the code for it, the functionality works in Desktop FireFox and InternetExplorer but not in Desktop chrome or Safari.
The add bookmark also doesnt work on android default browser or android FireFox browser.
It also doesnt work on IOS Safari, on IPad 1 and IPad 2
Is there any javascript API that allows the add bookmark functionality programmatically via javascript in mobile browsers?
If not, is there any other way to achieve this programmatically in mobile browsers?
Also will Phonegap or rooting the android phone, help in any way to achieve this?
I am open to all views.

Categories