Beforeinstallprompt not getting called in in-app browser - javascript

I have a pwa1 which will open in in-app browser of pwa2. I have install button for pwa1. But in in-app browser beforeinstallpromt is not getting fired. Any workaround for this?
Open in Chrome this link will open in chrome app from any other browser in Android except in-app browser of PWA. Any way to make it work for in-app browser?
Web share api shows lots of app when clicking share button except chrome app. Any way to add chrome app in sharing suggestions?

No, this only works in top-level browsing contexts according to the spec, but not in nested contexts.
Not that I know of, probably due to a similar limitation as above.
Chrome is not a share target, but you can copy the URL and open the URL on the clipboard with Chrome.

Related

URL Scheme to open Chrome/Firefox (Android OS) from Facebook post

We've a web page that needs to be open in Chrome/Firefox on Android to fully display the content. But when we post the link on Facebook, it always opens the links with its own web browser.
So we're checking if there is a way to force opening the link in Chrome browser from a Facebook post.
Here are some approaches that we tried:
Use Chrome URL Scheme (googlechrome://navigate?url=example.com)
Use window.location.href, window.open (url,"_system"), etc
And even using the intent to launch chrome from the web browser:
What is the intent to launch any website link in Google Chrome
If you have any idea or confirmation that there is no way to force users from Facebook Browser to Chrome (Android OS), please let us know.
Up until recently the googlechrome://navigate?url=example.com approach worked on both Android/iOS Facebook links when using an href with target="_blank". Recently this stopped working on Android Facebook. The only workaround I have found that works is to use an intent: link that does not specify a package path for Chrome. It will open the link using the default browser, so is not guaranteed to be Chrome. The specific link format that worked was:
window.location = 'intent:https://example.com#Intent;end';
IT appears that the intent is matching a generic URL to use the default selected browser when no package is specified.

How to fire "download from another browser" event from chrome? [duplicate]

Our Web application is based on IE9, which means only IE9 can open the pages in our site. We'll prevent user to browse our site when their browser is not IE9.
But sometimes we had to send a link to user's email box to complete some actions and they will open the link directly with their default browser, the problem is here, if the default browser is not IE9 then they can't open the link, they have to copy the link to IE9. Our user don't want do this manually, they want open the link in IE9 directly no matter what the default browser is.
I have tried using ActiveXObject, but it only works in IE. I want have a script which can open IE browser in Firefox/Chrome page.
It sounds like you want to have a link in an email that activates a specific program on the user's computer rather than the program that they've identified should be used (e.g., their default browser). I don't believe you can do that.
You can install "protocol handlers" in both Chrome and Safari (I suspect Firefox as well), which would let you send a link like ie://example.com/path/to/app. Your protocol handler would launch IE and take you to the relevant site. (Apple does this with iTunes.) But your users would have to install the handler (and, of course, you'd have to write it).
An easier answer might be to have the users install any of the ubiquitous "open in IE" add-ons/extensions that exist for Chrome, Firefox, etc. They follow the link, then choose "open in IE" from some kind of menu. (If they're using webmail, they may even be able to right-click the link and choose that line item, depending on the extension.)
Side note: Obviously, though, barring it being impossible I'd recommend making your application compatible with Chrome and Firefox.
No you can't do it..
but there is some alternatives:
Install your users IE tab:
FireFox - http://lifehacker.com/135297/internet-explorer-in-a-firefox-tab?tag=softwarewebpublishing,
Chrome - https://chrome.google.com/webstore/detail/hehijbfgiekmjfkfjpbkbammjbdenadd
Use a batch file that will launch your link in explorer.
use this Firefox plugin makes it possible to use (host) ActiveX controls in Firefox - http://code.google.com/p/ff-activex-host/
instead of ActiveX try using Netscape Plugin Application Programming Interface (NPAPI) - a cross-platform plugin architecture used by many web browsers.
Similar as with a batch file, you may create a link file to the page you need using the ".website" file extension with IE, which is configured in windows by default to open with ie. Put it in your webserver public folder and then add a link to that file in your website
You don't have to write code to create a custom protocol handler in Windows. See this page for how to define one in the registry.
You can use User agent switcher for chrome or firefox
For Chrome :
https://chrome.google.com/webstore/detail/user-agent-switcher-for-c/djflhoibgkdhkhhcedjiklpkjnoahfmg
For Firefox :
https://addons.mozilla.org/en-US/firefox/addon/uaswitcher/

Google Chrome Push Notifications not working if the browser is closed?

It is written here that the push notifications will work even if the browser is closed, but I tested it and it is not the case. I receive push-notifications only if the browser is open (doesnt matter if the particular webpage is open or not).
I tested this on chrome for Desktop & chrome for Android (after updating to latest version).
my question is :- For push notifications to work should the browser be open?
Note:- I used this for testing.
According to Can I Use, Chrome and Firefox desktop browsers require the browser to be running for receiving push notifications; mobile browsers typically don't.
Open Settings (in chrome)
Do the following:
> advanced
> system >
"continue running background apps when chrome is closed"
>enable
On desktop, browsers need a process running. For example on Mac OS X the browser can have no window open but if you look at the dock, the light underneath icon can be glowing (meaning it has a process running). In the scenario you should receive push messages.
If the browser was completely quit, then push messages won't get through.
The same applies to windows and Linux.
On android you should be receiving the messages regardless of whether the browser is open or not. This is in part (as far as I know) to the fact that android manages it's connection to the push service rather than the browser, so it'll receive messages whenever possible.
The messages should (eventually) get through even if they are sent while the browser is closed, or the device is offline, etc. (And this works for me using https://gauntface.github.io/simple-push-demo/ and other tests.)
I've worked on demo to provide push notifications on Google Chrome and Firefox. Demo -> https://twitter.com/d_danailov/status/1163824171480166400
If someone has a question could ping me on twitter.
The public URL: https://push-notifications-ddanailov.firebaseapp.com/
Repo: https://github.com/dimitardanailov/push-notifications
On desktop the browser needs to be running since that is the process that receives the push messages. Some extensions, like hangouts force the browser to keep running even when the last tab is closed so for users with one such extension installed push will work all the time.
On Android, the browser does not need to be running since the entity in charge of receiving the messages is baked into Google Play Services.
The Chrome team is working on the desktop issue in https://bugs.chromium.org/p/chromium/issues/detail?id=402456
It is possible to write Chrome extension where background script can run if Chrome is allowed to run in the background (configurable in settings). It can also use GCM.
EDIT:
For service worker to run in the background even if no tab or window is opened there must be at least one Chrome extension with background permissions installed and Chrome must be allowed to run apps in background. Tested on Linux.
Yes, the other users are right and there is no way to receive them on Windows if the browser is closed unless the browser is running in the background, which some Chrome Apps and Extensions can force. I ran into this recently and found this extension, which I believe may help. It keeps the browser running in the background even if the windows are closed but does not do anything besides that (it is open source and presumably the version uploaded to the Chrome Store matches that version)
https://chrome.google.com/webstore/detail/lightning-reopen/ahphokgmcecbjeipkfkamcdmemghkaph

html shortcut on smartphones

I wonder if there is any chance, either javascript or some code, to know if the user is visiting the page on the mobile device directly from the navigator or from a shortcut from the home screen? I need to know this so show a message to invite the user to create a shortcut and then use the web page in the app like mode.
This page notes how you can tell for iOS; you have to set a meta tag to turn on standalone mode and then check window.navigator.standalone.
However, as far as I can tell, there is no equivalent for Android's built-in browser or for Chrome on Android. See the documentation for mobile Chrome: "How can I detect if the app is running as an installed app?
You can’t, directly." And also: "Do not prompt the user to add your app to the homescreen. There is no way to detect if the app is running installed or not."

iOS open URL in safari instead of Facebook in-app browser JS, HTML

I just want to ask is there a chance to open url in safari instead of facebook in-app browser with javascript or HTML?
The problem is that I need to open it from either Facebook time line or by clicking link inside in-app browser. I have found some solutions here over stackoverflow, but none of them worked. Maybe you have any suggestions how to do that?
Because I saw that there was some changes over iOS 8, so maybe there is a new way to work around
Unfortunately iOS Safari app doesn't have a URL scheme that you could use to open your links from different app like FB.
You can make it work for a different browser app though, like Chrome. See
http://www.labnol.org/internet/open-in-chrome-bookmarklet/21526/

Categories

Resources