简体   繁体   English

从Chrome扩展程序加载Places API库

[英]Load Places API library from Chrome Extension

I'm writing a Chrome extension to add Google Maps autocomplete to Google Calendar's new event location input. 我正在编写一个Chrome扩展程序,以将Google Maps自动完成功能添加到Google日历的新活动位置输入中。 I'm trying to load the library in the extension context but it blocks saying [blocked] The page at domain.com ran insecure content from anotherdomain.com . 我正在尝试在扩展上下文中加载库,但是它阻止了[blocked] The page at domain.com ran insecure content from anotherdomain.com

I of course have added http://anotherdomain.com to the manfest.json in the "permissions" key. 我当然在“权限”键中将http://anotherdomain.com添加到了manfest.json中。 In order to load the actual places library I just downloaded it from http://maps.googleapis.com/maps/api/js?libraries=places&sensor=true , since i didn't know how to add it directly to the extension. 为了加载实际的位置信息库,我只是从http://maps.googleapis.com/maps/api/js?libraries=places&sensor=true下载了它,因为我不知道如何直接将其添加到扩展程序中。

So far, it seems it is impossible, so I just used the JSON API and jQuery UI's autocomplete. 到目前为止,这似乎是不可能的,所以我只使用了JSON API和jQuery UI的自动完成功能。 Here's my trivial implementation https://gist.github.com/3623683 这是我琐碎的实现https://gist.github.com/3623683

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM