I would like to know if there is a way to override Chrome's "Request Desktop Site" option when the user visits a mobile site?
All that feature does is spoof the user agent of the browser to make it look like it's coming from a desktop.
Source: https://productforums.google.com/forum/#!topic/chrome/tz24aCo6F3I
If you're making a responsive site, it shouldn't affect your design since it would base the layout on the screen size. If you're attempting to use browser detection however, this would affect how your site is displayed to the user since it will see the user as a regular desktop browser. There's really not a way around the user-agent spoofing other than looking at the screen size and making assumptions about the browser type.
Related
I have a very strange problem with my web app seemingly triggering a colour adjustment from the android device - normally colours are fairly vibrant, in the same Chromium based browser for other pages, but once switched to my web app, the screen's colour temperature turns cool, and saturation seems to be toned down, resulting in a dull grey looking page.
Other pages within my web app doesn't seem to trigger this colour profile change.
I cannot think of what possibly might be causing this. Is this solely something done by the device, and not possibly controlled by me, or is there something that can be done for the front-end code? This is a web app, and not a native app, so I can't access android APIs.
Is it possibly the mobile view of the website? I've seen websites have a poorly optimized mobile view, causing similar issues.
With iPhone you can display different content for the same URL depending on whether the page is visited in normal Safari or via a home screen icon for that webpage. If the page is visited in Safari then you typically display the instructions for downloading the app. And if the page is visited via the home screen icon then you display the app.
I currently have all this setup for a client. When the URL is visited by a non-iOS device, then the app is always shown(i.e. instructions are never shown like with iOS if visited in Safari).
My question is, on Android is there any way I can detect if the page is launching via a home screen icon or not so that I can display instructions or the app like on iPhone? If not, what's the best alternative?
This question has been asked many times on stackoverflow, but each time the correct answer was not working or not the correct one.
I am reopening this question, due to it's importance for mobile web device programmers.
I want to be able to stop rotation on a WEB SITE on a browser on one of the following OS: IOS and/or Android device or at least to modify the rotation to last landscape at least. So only landscape is permitted as a rotation.
I have tried many related questions with no solution:
Blocking device rotation on mobile web pages
Jquery mobile device rotation shrinks the screen
Any idea is welcome, thank you.
p.s.
#CommonsWare is right, you shouldn't just block the user from being able to rotate their device however they want. In fact, that's what makes mobile web apps so versatile. They encompass the principals of responsive design.
I know this isn't the answer you're really looking for but if you insist on doing so, take a look here: Block mobile web rotation with javascript.
I'm not sure but I'm guessing that still won't work simply because a web app isn't native to whatever device you're viewing it on and the app you're actually in is a browser eg Chrome, Safari, ect and those are almost certainly going to have different orientations enabled regardless of what your web app is doing.
I have a mobile web page which includes an input element of type 'file', to allow users to upload image files to a server. The page works fine on iOS, and on a Nexus 4 (Android 4.2.1) in the Chrome Browser.
When I use a Samsung S3 (Android 4.0.4) with the default browser clicking on the 'Choose file' button opens the image selection dialog as expected, however after I choose an image and close the dialog the web page gets refreshed, so I lose the image that was selected. Has anyone else seen this behaviour? Any suggestions for a workaround?
The input element that I'm using is fairly standard, and looks like this:
<input id="addPhoto" type="file" accept="image/*"/>
Even without the 'accept' attribute I get the same problem.
Have a look a this issue:
https://code.google.com/p/android/issues/detail?id=53088
Basically, what seems to be happening is this:
Android does not have enough memory available for the file-chooser or camera app.
It frees up memory by closing the browser
After the file chooser/camera is closed the browser is opened again, triggering a page refresh, which renders the whole file choosing exercise useless.
It seems to me that this is beyond the control of any browser based solution but I would love to be proven wrong on this assumption.
I'm having the same problem on a phone with Andriod 2.3.6. One of my colleagues does not have the problem on his phone (can't recall what that is running). He suggested it may be a memory issue. If the phone doesn't have enough available memory, the browser might actually be forced to reload the page after selecting the picture, which defeats the purpose. I have not yet been able to confirm that this is the problem, but my phone does have considerably less available memory than his.
You could try this JQuery Method: http://blueimp.github.com/jQuery-File-Upload/
Uploadify also looks promising: http://www.uploadify.com/
Here's a demo of it: http://www.uploadify.com/demos/
I think the problem is not your code, but the default Android browser you are using.
is it possible to tell a mobile browser, that as long as a certain HTML page is displayed, the device should not turn off its screen?
I want to build something like Project Blinkenlights, but every participant brings his/her own pixel. To set each display to a certain color at a given point in time is managable, just let each one open a website that shows a blank page and changes the background to color the screen. I'd use JavaScript to link the devices and have them log into a control server. But having the pixels wink out because the devices go to sleep would somehow break the concept.
A dedicated app would be overkill, and not every passing onlooker would install an app anyway (at least I wouldn't).
Thanks in advance!
I'm pretty sure you can't do that without bundle your webview inside an app. And whatever is the OS. It's all about protecting the user (and his device battery)