Does HTML5 allow JavaScript to open, close, or switch to a tab in the browser? Can I call a JavaScript function to perform these in any HTML5 browser?
Nope, javascript or HTML5 has nothing to do with switching tabs of browser. You can open/close/focus popup windows though.
There's no standard API for that.
You can only do it if you create a browser extension in Chrome, Firefox or Safari
You will be able to control the tabs from Javascript but that will work only for those users that explicitly installed the extension in each browser.
Related
in this piece of HTML code
PARTECIPA
the opening of the website in the Microsoft Edge browser is indicated if installed on the device.
Can anyone help me? I would like the site to open in Google Chrome and not in Edge.
How should I edit this HTML?
To open the link using the Chrome browser instead of Microsoft Edge, you can change the value of href attribute like this: PARTECIPA. Assuming that Chrome browser is installed, that should open the Chrome browser.
Problem:
If Edge is not installed on the device (mob, desk or tab) it doesn't
work
In this case, it's best to simply use a standard URL without specifying a specific browser, like this. PARTECIPA. In addition, the "googlechrome:" protocol is not a standardized protocol and probably may not work in all devices. So, you can use a standardized URL like the code snippet I posted above and let the users device choose.
Do you know if instead of chrome I can specify "default browser"
Example PARTECIPA or
something similar?
There is no standard protocol for specifying the default browser. So, best approach is to simply use a standard URL without specifying a specific browser. But if you really want to use special web protocols inside hypertext links to force web pages or files to open with particular browsers on Windows or iOS, place browser-name before the hypertext reference link.
Check this:
Open in Google Chrome
Open in Microsoft Edge
Open in Mozilla Firefox
Open in Apple Safari
Open in Opera
This function does not work!
A similar example is for IOS, which works in the following way
Example :
PARTECIPA
Google has official documentation on the Chrome iOS app’s URI scheme on its developer website.
Simply replace http with googlechrome and https with googlechromes. This means:
http://www.google.com/ becomes googlechrome://www.google.com/
https://apple.stackexchange.com/ becomes googlechromes://apple.stackexchange.com/
Previously, it supported an x-callback-url of googlechrome-x-callback://. This allowed the calling app to indicate its name and URI scheme to Chrome, which would show a back button in the address bar that closes the tab and invokes the specified URI. This feature was removed a few years ago when iOS 9 added the “Back to …” button in the status bar (but the URI scheme still works).
I'm trying to load http://m.zara.com from my desktop browser. I have tried with Chrome developer tools to change the user agent to mobile. I have also installed User-Agent Switcher plugin for Chrome without any success. For some reason it is always redirecting to the desktop version.
Why is this not working? How could I manage to do this?
Checkout the link here
Try to download user-agent extension in chrome browser and then you can use the online parsers available in this blog.
There by the simulation of browsers can happen for cross browser access.
I would like to know how to use input[type=color] on Chrome Packaged App. When I open the HTML file on the browser, the input[type=color] works well, it pop ups the color picker, but when I used it on an app, it doesn't do anything. Please help me how to enable this HTML5 feature.
Are you looking at the app from a mobile device? The web browser for the device might not support input[type=color]. It looks like iOS doesn't at this time. See the compatibility tables.
<a href="http://192.168.1.1"
onclick="Popup=window.open('http://192.168.1.1','Popup','toolbar=no,location=no,directories=
no,status=no,menubar=no,scrollbars=yes,resizable=no,width=800,height=300,left=300,top=23');
return false;" >
<button type="button">button</button></a>
If i'm browser this page in firefox, it pop up a new window in firefox when i click button.
if in chrome, then it pop up in chrome.
What if i want the pop up window always open in IE even when im browser this page in other browser?
Thanks!
Browsers cannot start other programs except with a plugin installed.
You can't do this. It breaks the sandbox model -- javascript in chrome, firefox, etc., executes in a security sandbox and there are lots of things it can't do. It can't save files to your hard disk (malicious code could overwrite your OS) -- it can't open arbitrary executables or start processes (malicious code could run a virus/malware). Javascript doesn't have the ability to do this.
As mentioned, browsers cannot start other programs without plugins or similar functionality.
I think your best bet is to detect IE on the other page. I don't believe there's a way to force IE. You could provide the link for them to easily copy and paste into IE, such as in a text box that is fully selected when they click in it.
we have a website with links to a sharepoint. These features in sharepoint only work in IE so i dont want to open up firefox or chrome if that is the default browser. Is there anyway to have a
My Link
force open up in internet explorer ?
You can use javascript to inject the link in your HTML code if the client is IE, and maybe show a warning message if the browser isn't IE. Anyway you can't tell any browser to open a link using another browser.
No, definitely not.
For Firefox users, the best thing that comes to mind is to have them install the IE tab. It allows the opening of pages inside Firefox but using the IE engine - but also requires user action.
If this is run in a windows environment, you could use a PHP script to open Internet Explorer through PHPs support for COM objects.
If you are interested I can provide the script to do this.