Is it possible to reset the location warnings in ios from javascript run on the website?
I am finding that if users keep denying access to their location when visiting my website that eventually they no longer get the choice. Now I know that they can reset their settings on their iPhones but I would like to be able to force the "Deny or Allow" dialog box to appear every time they visit my website.
Is this possible? If so how?
Related
I am currently working on a screen capturing feature in chrome using
navigator.mediaDevices.getDisplayMedia
I am only able to open a user selection where the user can choose from all the given displaymedias. Is there any way to go around the selection and select a tab via the tab name automaticly?
https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia
I have read the privacy and security part in which it says that
In addition, user permission is always required to access the user's audio and video inputs.
but im still wondering if there is a way?
very few available constrains for getDisplayMedia
getDisplayMedia({preferCurrentTab:true}) // in chrome 96
hopefully getViewportMedia, getViewportScreenshot coming soon
When the user opens the website to the mobile device, the browser should ask Add To Home Screen or Add Bookmark To Screen like PWA for every single page I mean different for every URL.
Note: Here I'm not talking about PWA (Progressive Web App), I know how to create PWA and I've created it.
I just want to know that what I am asking is possible or not to ask the user to add a bookmark on every single page he opens just like PWA.
No. You cant. Here is my detailed answer on why.
That would be so annoying to a user and no browser will let you do that (even if you think its a valid use case for your scenario).
Thats why browsers don't give control over how the install prompt event is triggered. Install prompt can be caught and shown once in the right time when you think user will be convinced to install it. If the user defers to install, you need to wait for a long time to catch the same event again to show the prompt again. How long is something depends on the browser and there is no standard time defined by any browser vendor.
Basically, if browser thinks user might like to add again based on the length and frequency of usage, then it will trigger the prompt event again. But that wont be in the same session/day for sure.
I have spent considerable time researching this and hopefully I have just missed something so I thought I would bounce it off the StackExchange community as well.
Background:
On latest Chrome > 65, all of the notifications are stores on a per-site basis, so if one were to grant or deny notification popup for a SITE and want to reverse that decision (accidentally clicked the "block" for example) they can simply go into Chrome notification settings, find that specific site, and remove the block. This works as designed today and is well documented.
So here is the issue detail in a scenario:
Now, that exact same mechanism is used for extensions. An extension is initially granted all it's required permissions and works properly. Then, the user accidentally clicks "block" one time on a single desktop notification from the extension using the "gears" cog-wheel icon on the notification which then changes the notify balloon to this prompt:
Now, any time that extension attempts to send a notify message, instead of the normal desktop notify, an ugly javascript notify pops up in the middle of the screen (with the exact same notify text), and two buttons - "OK" and "Cancel". All extension functionality is unchanged if "OK" is clicked for example, the very same functions fire as if the user had clicked the prior desktop notify balloon popup.
Here are two screenshots of this exact scenario using the popular Tampermonkey Chrome extension (using a randomly selected script with a known update) that uses desktop notification API to communicate script updates:
"Normal" desktop notify message with default grant permission:
The exact same message (appears in center of the screen) once that permission is revoked by user clicking "block". **Note the actual message itself is not blocked which I find odd, just the desktop notify GUI bubble:
So, the question is really 2-fold:
Where does Chrome store that boolean value of PermissionLevel FOR EXTENSIONS - as they do NOT appear in the normal list of granted/blocked SITES. If not in the UI, is this setting exposed in a configuration file or is there even currently any way in Chrome>65 for the user to ever reverse this decision?
Is there either a programmatic method that can be implemented by an extension developer on the back-end to ever check if this has occurred and re-prompt the user to change their mind and re-grant that permission? I have found a couple unofficial posts here saying common sense says no to avoid malicious harassing of users etc. but I cannot find anything official.
Well, I can confirm after opening this as an official Chromium bug, that it's sitting waiting for triage and clearly has no current workaround here:
https://bugs.chromium.org/p/chromium/issues/detail?id=825497
I also did further testing to determine you can use the ID from the extension and add it into "sites" settings which also based on that behavior, appears to be yet another bug due to some settings not saving, none having desired effect, etc.
I will post this as the current answer as of 04-09-2018:
"it is impossible to re-enable Chrome desktop notifications FOR A SPECIFIC EXTENSION once blocked".
If anyone can post here a successful workaround to in any way re-enable the normal desktop notifications for an extension (tested with Tampermonkey) after the user clicks the "block all notifications from this app" to simply reverse the decision that would be great but I think as long as this has remained unanswered makes me lean towards believing there simply is no current method and it is just a (glaring) UI bug.
Sadly the only method for reversing this is to remove the extension and re-install it.
This issue has been open for nearly half a year. Not expecting a fix any time soon at this point. https://bugs.chromium.org/p/chromium/issues/detail?id=825497
Please star this issue at the link above if you're affected by it.
Its more for web development, I wonder once a user clicked yes on the browser's location request, then refresh the same page, it does not prompt again. I wonder what is the thing that control if its going to prompt again? Is there way to allow the prompt to trigger again with javascript?
for example the prompt looks like this in safari
I'm getting a trouble while running JS code in a browser.
I've got a small web page which uses HTML5 location API for tracking a user.
User opens my website, logs in, and goes to a certain page on which I'm using location API to track user's location. Everything works fine until user's phone goes to sleep or user presses "home" button to minimize browser. The same thing happens on both Android and iPhone.
Is there any way to prevent the phone from going to sleep and let JS code work while browser is minimized?
one of the way I found is using video on a page where all JS located. but another problem is - screen became always ON, which can cause battery to discharge too fast (if I turn off screen manually using power button everything stops working)..
still looking for some ideas...