google / google-visualization-issues

288 stars 35 forks source link

Bug: Chart API will not work with chrome app manifest version 2 #978

Open orwant opened 9 years ago

orwant commented 9 years ago
Hi,
Content security policy of Google chrome extension/app manifest version 2.0 has following
restrictions on apps:
1. Inline JavaScript will not be executed.
2. eval() statements are disallowed.
Please follow http://code.google.com/chrome/extensions/contentSecurityPolicy.html#H2-3
  for more details.

Currently Google Visualization API is using:
1. eval on corechart.I.js (3 times)
2. eval on jsapi 
3. inline scripts (body ONLOAD on the chart iframe)
chrome apps using chart apis can not be updated to v2 till these issues are resolved.

What component is this issue related to (PieChart, LineChart, DataTable,
Query, etc)?
Chart API

Are you using the test environment (version 1.1)?
(If you are not sure, answer NO)

What operating system and browser are you using?
Chrome version 22.0

*********************************************************
For developers viewing this issue: please click the 'star' icon to be
notified of future changes, and to let us know how many of you are
interested in seeing it resolved.
*********************************************************

Original issue reported on code.google.com by pratibhag@google.com on 2012-07-27 06:04:27

orwant commented 9 years ago
As of now manifest version 1 apps are not being added in webstore.

Original issue reported on code.google.com by jainrohit@google.com on 2012-08-02 06:34:49

orwant commented 9 years ago
For Chrome Apps you can either use <webview> or sanboxed page that you can embed in
you page.
In first case you have limited communication with embeded page. For sanboxed page you
can communicate with embeded page via window.postMessage. Sandbox is also available
for Chrome extensions. Note that sanboxed page do not have access to chrome API.

Original issue reported on code.google.com by jarrodek on 2013-11-02 10:46:54

orwant commented 9 years ago
apparently its possible to load jsapi and chart api from the background page, then use
it in content script like:
var background = chrome.extension.getBackgroundPage();
if (background.google && background.google.visualization) {
  //use it    
}

https://gist.github.com/battlehorse/1240641

Original issue reported on code.google.com by zmandel on 2014-07-21 16:53:42