RC-Paves3-build / plovr

Automatically exported from code.google.com/p/plovr
0 stars 0 forks source link

Enable CORS in plovr to make development easier #62

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
It would be nice to have a configurable option in plovr to allow CORS: 
http://www.w3.org/TR/cors/

There are instances when it's inconvenient to have a complex web app's html be 
served by plovr.  This will cause a CORS violation since the web app server's 
html and plovr's JS are on different ports/schemes.

A minimum functionality suggestion would to simply put the following into the 
module and input file handler's response headers if a CORS option is set in 
plovr config:

Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: *

Please see a naive approach in the attached file that works for my environment.

Thanks for your time,
Rick

Original issue reported on code.google.com by ri...@celtx.com on 11 Apr 2012 at 7:02

Attachments:

GoogleCodeExporter commented 8 years ago
Does this only happen if you use the XHR-based module loader? You can turn that 
off with moduleLoader.setDebugMode(true) when developing.

Original comment by ibmirkin@gmail.com on 15 Jul 2012 at 7:06

GoogleCodeExporter commented 8 years ago
Yes, it's true; this happens only when using the XHR-based module loader.  
Thanks for your help.

Original comment by ri...@celtx.com on 18 Jul 2012 at 4:35

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
It seems (?) things have changed.

moduleLoader.setDebugMode(true) is no longer enough if you're developing on 
CHROME.
In moduleloader.js:291, we see that <script> (rather than XHR) will be used:

if (this.getDebugMode() && !this.usingSourceUrlInjection())

and the second condition is basically "is the broser Chrome?".

Is there another workaround? I'm using an ugly method override wrapped by a 
goog.DEBUG check... 

Original comment by andre.tannus on 8 Mar 2013 at 10:17

GoogleCodeExporter commented 8 years ago
People interested in this thread might be interested in:

https://github.com/rgpower/plovr

Original comment by ri...@celtx.com on 14 May 2014 at 1:38