When I am creating google map on hybrid app and network suddenly disconnet, the google map show nothing after network has been reconnected. I got a error message as below and try to reload google map javascript again. Sometimes the map was created success but always failed. Is there any solution for this problem?
GET http://maps.gstatic.com/cat_js/intl/zh_tw/mapfiles/api-3/16/2/%7Bcommon,map%7D.js
net::ERR_PROXY_CONNECTION_FAILED %7Bmain,places%7D.js:10
GET http://maps.gstatic.com/cat_js/intl/zh_tw/mapfiles/api-3/16/2/%7Butil,stats%7D.js
net::ERR_PROXY_CONNECTION_FAILED %7Bmain,places%7D.js:10
watchPositionError 0
I know it can be annoying to think about, but at some point you just have to put it out of your head, and an important thing to take note of is sometimes the user will enter into situations where your app doesn't work exactly as you want it to, and it's out of your control, for example if the user disconnects the internet.
Another example of this would be if the user doesn't support cookies, or if they don't support javascript. As a developer, you won't always be working with the resources you need to build software for every person on every platform and in every scenario. Sure google has the ability to handle internet disconnect/reconnect in google drive, syncing up to the server when a connection is re-established, and Twitter has a mobile site that supports users who don't have javascript. As a developer you will have to make a judgement call on what is and what isn't a must-have feature. I'm guessing this isn't a must-have feature.
Related
I'm currently developing a web app that allows users to add a list of websites that they want to block i.e. preventing them from accessing the website from their browser.
Ideally I want to be able to block websites on every browser but this is difficult, so I narrowed my research to just Chrome for now. I came across the chrome.webRequest api which seems promising but it specifically says its for chrome extensions and am unsure if it would work for my web app.
Can anyone point me in the right direction for blocking websites on a web app, ideally using javascript. Any help is much appreciated!!
EDIT:
1) I forgot to mention that I'm using firebase for my backend.
2) People have been saying that I can't block websites outside the web apps scope, if I instead used electron to make the web app a desktop application would it then be possible?
Firstly you have a database containing URL of blocked websites. URLs are modified using your web app. That's one part. Now your problem is how to make the browser work with your database.
The only possible way for you to share blocked URLs with the browser is via API. You must have API that can communicate outside your web app.
Now browsers such as chrome/firefox give users the power to make changes inside and outside the dom. For chrome, you have chrome extension where Google provides API so the users can manipulate actions outsides regular actions such as manipulating dom. An example I can give that is closely related to your subject matter, which is an action activated before/after a user enters URL on the search box and for that, we use the following API from https://developer.chrome.com/extensions/webRequest
And it's same for Firefox.
Google came up with a new feature called Google Web Light. This optimizes websites that are not mobile friendly and are heavy for users with slow connections. Sometimes even YouTube gets optimized.
They URL is like this "http://googleweblight.com/?lite_url= website url".
So, this causes some issues to websites. Mostly JavaScript issues. Take a look at these jQuery UI elements. Nothing seems to work.
Sure there is a link to view the proper website but users won't bother clicking and would leave thinking the website is broken.
How would you go around this. Is there anyway to detect if the users browser is showing the optimized website?
Here is an example of what it looks like:
This explains how to opt out of WebLite:
If you do not want your pages to be transcoded, set the HTTP header "Cache-Control: no-transform" in your page response. If Googlebot sees this header, your page will not be transcoded.
To detect WebLite instead use $(document).ready() in a script to detect if one of those new WebLite elements exists in the loaded DOM:
if (document.getElementById('lite-menu') != "null") {
alert("WebLite is being used") ;
}
If you have a fully responsite site then WebLite will only be used for slow connections
To those of you that land on this page because you keep getting redirects using Google Web Light:
Download firefox through Raspbian Repository (or your default linux distro repository) and then seek out a browser addon to change "user agent" to desktop (just search addons for "User Agent" and you'll find something). Once done, Google will no longer terrorize you with an service they think helps you so they force it upon you.
(This may apply to others not using Raspbian such as any mobile device or small screen computer).
I am trying to use the Google+ sign in button via the javascript api. Everything works fine on Windows computers and Chromebooks, but it fails on every Mac that I have been able to test it on. (see update 2 below, this is not actually a Mac problem)
When the initial Google api file is loaded (https://apis.google.com/js/client:platform.js) an error is logged in the console, saying that https://accounts.google.com/o/oauth2/iframerpc?scope=email+profile&response_type=token+id_token&login_hint=[HINT]&origin=[ORIGIN]&action=issueToken&ss_domain=[SS_DOMAIN]&hd=[HD]&client_id=[CLIENT_ID]&hl=en&from_login=1&as=[AS] returned a server side error. When I pull up the URL in the browser directly, I get a JSON object with one property:
{"error":"internal_server_error"}
This only happens on Mac computers (Google Chrome, haven't tried another browser), and it all works fine in an incognito window. (see updates below, Mac is not the problem)
UPDATE:
I have determined that this only happens when a user is signed in to multiple Google accounts; and moreover, only when the user is trying to authenticate to my website using one of the accounts that is not marked as the "default" account (a.k.a. the first Google account that they signed into).
This also happens on Safari.
UPDATE 2:
This is NOT a Mac issue, it just happened to be coincidence that the 5 or so users that this affected were all using Macs (even though our company probably only has 10 out of 200 users that use Macs, and the only people reporting this error happened to be using Macs).
The real issue happens on any computer, but ONLY when the user is signed in to multiple Google accounts and tries to authenticate to my site using a one of their Google accounts that is not the "default" account.
P.S. Thanks to #brenjt for the subject update, which turned out to be very accurate.
Thanks for the report, Blair. It took us a while to dig into the root cause of this one, and were assisted by your comments. Assuming it's the bug we think it is - we pushed a fix to production around last Wednesday that resolves the issue. Please let me know if that's not the case!
I am currently working on a custom uri-scheme (protocol) in google chrome and require a method to automate some testing (and development) of this protocol purely from within the chrome browser.
For example. If a redirect/anchor link points to this example uri
testuri://thismessage/additionaldata
then I would like to to redirected back into JS somehow. I.e. with a call to say
function protocolMessage(data) { ... }
I have explored the use of 'navigator.registerProtocolHandler' but that requires the use of 'web+testuri', which isn't an option (unless someone knows of a setting that can be used to turn this off).
I have investigated using a chrome custom extension to capture the uri under webNavigation but it doesn't capture anything but http(s) schemes. And I cannot see any functions that would allow me to register a custom scheme directly either.
Further investigation led me to try calling out to a system application (using custom uri-schemes that call native executables) and this partly works but now i'm stuck on how to redirect that message back into the current page/tab's javascript.
I also had a look at NaCL (Pepper API's) but that doesn't seem to allow registration of custom schemes either.
I am hoping for a better solution than calling out and back into the browser, but if not can anyone shed any light on a good solid reusable solution?
Any ideas?
Thanks in Advance
To my knowledge, no, sadly.
All Chrome APIs work with "supported schemes" and you can't add one.
web+custom: is also an inflexible limitation.
If you have a system application, you can talk to it by either providing a WebSocket server in the application, or working with Native Messaging.
The problem with native messaging is that Chrome has to initiate the connection to a new instance of the Native host. So you'll need to be able to handle the native app being invoked separately for protocol handling and for messaging.
Our website is an AJAX website that makes no page requests after the initial start up of our website. Information is communicated with the server through XMLHttpRequests.
Our website allows users to work online and offline without a connection during a user session. When a connection is detected our website "synchronizes" with the server.
Our problem is that if the internet browser running our website crashes while the user has no internet connection the user cant begin working with our website until she/he gets an internet connection back.
Is it possible to have the browser cache the initial startup page (index.html) along with the other website resources and have the browser use the cached version of the startup page when there is no internet connection present?
(Google)Gears is exactly about this.
Today: use a service worker.
The 2009 answer: Not with any technology built into common web browsers.
You can achieve this using (the defunct in 2020) Google Gears, but that requires the user to install a plugin and grant permission to your website to use it. Google Docs and Wordpress are examples of web applications that use this.
This really isn't feasible. You could look at Smart client technology if you truly need to work offline. That'll be a lot of work though depending on the size of your application.
Technically it is possible. Google Gears does it. So Google can now save your entire gmail app on your local machine and operate without an internet connection.
You can use HTML5 databases, check the iPhone version of gmail for offline functionality without a plugin.