Current Location asked though not needed - google-maps

In an iPhone app I am opening a UIWebView object that I load with a URL like the following:
https://maps.google.com/maps?q=36.294384,-85.749443&iwloc=A&hl=en
(an arbitrary location, somewhere on the planet)
The strange thing is that I get asked the permission to use the current location, when clearly I have no use for it. Why is that?
The fact is, the app works in any case, regardless of my answer to the question above.
But why the question in the first place?

It's because the Google Maps website is using Safaris web API to ask for location. One can get a persons location using Safari and Google uses this functionality in their web version of maps.
edit: It's not currently possible to disable this prompt in the UIWebView (or any browser for that matter)

Related

Google Chrome Extension Top Sites Images

So using the Google Chrome Top Sites api has values for the url and the title, but when you load the default google chrome page it also has an image of those sites, is there any way to get that sort of image for an extension? If not how does google get that image and how can you get an image of the the user's top viewed website?
Since that it isn't possible to get a screenshot of a page without loading it inside a tab, Chrome is simply getting those screenshots while you're browsing your favourite sites. You can tell this easily because sometimes sites and images do not coincide (e.g. sometimes my facebook.com top site has the image of my profile page, but links to the home).
Then, if you want your screenshots of the Top Sites, you'll have to start without screenshots, and create them while the user browses the web by using the chrome.tabs API to check when a tab loads one of the Top Sites (listening to the event onUpdated), and get a screenshot of that tab using captureVisibleTab.
NOTES: make sure that you've requested the permission for "<all_urls>" in your manifest, which is required for captureVisibleTab to work. Additionally, you may find this question and its answer helpful.
It's unfortunately not possible*. Chrome stores those thumbnails internally in URIs not accessible from an extension.
There is an existing feature request: https://code.google.com/p/chromium/issues/detail?id=11854
If you look at the comments, one of the main use cases is to access site thumbnails to replicate the New Tab page.
Do star the feature request above to raise its priority if you want this functionality implemented.
* By that I mean that it's not possilbe to access Chrome's own internal store of thumbnails.
Furthermore, as Marco suggested the way to replicate that would be tab capture, but you can't do it "in the background" for privacy reasons - a user must make an explicit gesture (e.g. click the extension's button, press a shortcut, etc.) to perform capture.
Marco's answer is valid now, captureVisibleTab should be accessible upon events. But yes, as of now Chrome forces you to have very broad permissions and maintaining your own thumbnail store.

Does the latest Instagram iOS app support caption in URL scheme?

Formerly it was possible in iOS to use the hook instagram://camera?caption=YourCaptionHere (from Mobile Safari, or elsewhere) to have the Instagram app open in camera mode with a pre-filled caption. However, that no longer seems to be the case as my previously working URL (hook) no longer populates a caption (though it does still open Instagram in camera mode).
I'm having trouble finding any current information on this, though the caption query string variable seems to have never been documented in the first place.
Does anyone know if this feature is still available under a different query string variable?
To be more clear, I have a link on a web page that attempts to open Instagram in camera mode with a caption. I have a JavaScript click event that checks after 500ms to see if the page is still open, then alerts the user to download the app if the link didn't work:
Open Instagram
Instagram provides documentation on iOS hooks. That documentation does not make any mention of a caption parameter, except sharing a photo via Obj-C (in which they call it annotation). Given the different naming, you could try instagram://camera?annotation=YourCaptionHere and it might even work, but this doesn't seem to be an officially-supported use case.
Further, to support your second paragraph, searching through the history of the docs on the wayback machine doesn't turn up any mention that caption was ever a supported argument... like you said. Interestingly, one of their co-founders claimed this was available 2 years ago... I guess they never made it official, then removed it?

Google maps - current location - no HTML5

I am using google maps on a simple HTML website. I can center the map on user's current location using HTML5, but that requires getting permission from the user.
Now, when I go to maps.google.com, the map is centered around my location pretty accurately, without asking my permission.
How can I do that? When I define the map in my HTML webpage, I need to identify the center. How can I set the center to the center that google maps automatically finds?
Thanks.
assuming your in chrome go to the google maps page, then press f12 goto the resources tab, expand local storage, session storage and cookies, delete all entries from there, close the tab, go back to maps, notice it will no longer have your location, you'll need to click on the sniper type gps icon and it will ask you in you browser if you want to allow location.
answer being it has to ask you for permission, there is no compromise whether it's google or anyone else.
Your only other option, if you are serving any content server-side, would be to attempt to get the user's location from his or her IP address. There are a handful of APIs and services out there that will give you approximate locations, but your mileage may vary greatly. And, as I mentioned, you would have to execute that code server-side and then return some lat-long back to the client side to initialize/update your map.

Get the active tab url in crossrider

I came to know that crossrider.com is helping us to develop extension for different browsers, while keeping the same code.
I have two questions
Question 1:
After going through docs and libraries in crossrider, I still wonder how to get the active tab url.
Question 2:
I also need to open a popup after clicking toolbar icon, similar to google chrome extension.
I came across crossrider siderbar plugin. But, I am unable to change the url for sidebar dynamically.
Do we have any other crossrider plugins which opens like an popup ?
Answer Q1: You can use our appAPI.tabs.onTabSelectionChanged(function callback([{tabId, tabUrl}])) method (soon to be documented). To keep track of the ActiveTab URL, in the callback, simply set a global variable to the callback's optional tabUrl parameter. This is currently supported in Chrome and Firefox.
Answer Q2: I'm afraid that currently there isn't a native popup plugin (your welcome to write one and submit it for consideration ;-)). However, you can configure and use jQueryUI popups from within the extension.
I need to get active tab url in IE.
If it is not possible using jquery in IE, can we use messaging api to send messages from pages to background scope, and store the active tab url in background's global variable?

resource interpreted as image but transferred as text/html while working with Google Maps

A newbie with google maps, I have recently started reading.
For one of the projects, I had to plot a few points on a map.
I picked up a demo/sample piece from Google's API home for maps, and started adapting it for my requirements. All went well.
However, at one point in time, I decided to insert a button, which needs to be clicked to show the map, else the map is not shown by default.
Still, there is no error on page load, however, as soon as I click the button, I get this message "resource interpreted as image but transferred as text/html"
Tried figuring out if I am setting the content type explicitly somewhere but no, couldn't find anything.
Anybody seen that ? would appreciate help.
If this error is related to a URL which contains "gen204" then just disregard it. This is a known issue with Google Maps on some browsers, but is completely harmless. Visitors to your site should not be impacted unless they have the developer console open, and then all they will see is a log.
These annoying warnings cluttering your console (and mine) are:
Harmless: They're related to performance logging, not maps API functionality.
Not your fault: They're Google's fault.
(Though it's not entirely clear whether Maps or Chrome should be
responsible for fixing the problem.)
According to this post in the Google Maps API forum (emphasis added):
This is a logging beacon. It records the time to load the javascript, tiles
and so on. The server responds with HTTP 204 which, being an empty response,
should not require a MIME type.
So, the problem isn't how you're using Google Maps, it's how your browser is (mis-)handling HTTP 204 responses from the Maps performance logging code.
There are WebKit
and Chrome
bugs filed against this issue, but they seem to have gone dormant.
I recently ran into the same problem when scrolling a map - when I scrolled no new map tiles appeared and I saw 'resource interpreted as image but transferred as text/html' in the console. Upon investigation my map generating code (a fork of Mappable for silverstripe) was generating a marker with an empty icon file. When I fixed this, the map started working normally again.
I'd also added a second map to the page for testing purposes, this too showed the same break until I fixed the icon above.