There are alternatives such as put is online or use Firefox do debug,,
but I want to know if there's a method to load that .js
lib on Chrome.
Asked
Active
Viewed 6,831 times
0

jiyinyiyong
- 4,586
- 7
- 45
- 88
-
Possible duplicate. http://stackoverflow.com/questions/5074680/chrome-safari-errornot-allowed-to-load-local-resource-file-d-css-style – Larry Battle Apr 12 '12 at 14:47
-
Could you post your code that imports the coffee-script.js library. – Larry Battle Apr 12 '12 at 14:48
-
I mixed different situations up and made mistakes. Here's what I want to ask now. I ran a `node` process to serve a page which refers a 'coffee-script.js' file on another domain. While the `.js` was on my laptop and I use `"file:/home/chen/code/home/git/docview/libs/coffee-script.js"` to refer it, it gives out thie `Error`. And the source: https://gist.github.com/2374764 – jiyinyiyong Apr 13 '12 at 07:20
1 Answers
0
Problem:
<script src='file:/home/chen/code/home/git/docview/libs/coffee-script.js'></script>
Why:
"Only local script and and object resources are loaded"
Solution: You need to include the coffee-script.js file in the package folder and access it from there.
Source: http://code.google.com/chrome/extensions/trunk/contentSecurityPolicy.html#H2-0

Larry Battle
- 9,008
- 4
- 41
- 55
-
Could you give a simple demo please, for how can I solve this problem for this case? – jiyinyiyong Apr 14 '12 at 05:04
-
All you need to do is include the coffee-script.js file inside your script folder for your google chrome extension. Then have the src attribute reference the file using a relative location. Example: script src="/libs/coffee-script.js" – Larry Battle Apr 16 '12 at 17:41
-
But here I'm using Node to handle the URL of the request, is there still a relative location here? – jiyinyiyong Apr 17 '12 at 04:17