score:3
Accepted answer
The
play.filters.headers.contentSecurityPolicy = null
is correct, now remove
<meta http-equiv="Content-Security-Policy" content="default-src 'self'">
and then it must work as you expected
score:2
The best way to avoid this problem would be to use an extra javascript file which contains your code. but i had a similiar problem and solved it by setting a very long policy in my application.conf
play.filters.headers.contentSecurityPolicy = "default-src 'self';script-src 'self' https://my-site.com 'unsafe-inline';style-src 'self' https://my-site.com;font-src 'self' https://my-site.com;img-src 'self' https://my-site.com data:"
my-site.com is the hostname from where my app is served.
Source: stackoverflow.com
Related Query
- Play Framework won't run inline javascript
- Activator : Play Framework 2.3.x : run vs. start
- How to run Play Framework 2.2.0 with -feature option
- Inline variable in the Play framework 2.x Scala template
- Getting a raw string back for use in Javascript in Play Framework 2.0
- Using curly braces in JavaScript in Play Framework template
- Play Framework 2.3 and javascript websocket client library
- Run test in memory db play framework
- How do I run a comand line scala script that uses Play Framework app database?
- Play framework 2 - i18n in javascript files
- Creating Test Scope/Context to seed data and run application, Scala Play Framework 2
- Convert a javascript variable to scala in play framework
- when I run the play framework example with sbt some error
- Play framework Twirl template comparing javascript element and scala variable
- Play framework Scala run job in background
- Populate Javascript array using Scala List in Play framework template
- Scala JavaScript Routing Play Framework
- Rendering inline HTML from Play Framework using Scala?
- How to show streams inline as HTTP chunked response with play framework
- Play framework 2 scala templates - JavaScript
- Develop and run under different versions of Play Framework
- Play framework JavaScript function as scala template parameter
- How do I link external Javascript file to a html document in Play Framework project?
- Copy third party javascript files in play framework
- Play Framework run in production: Bad root server path /var/project/play.crypto.secret
- Play framework not found value routesGenerator when running activator run
- Play Framework - Defining my Javascript file within a function
- unchecked checkbox can't be set to be checked by Jquery or Javascript in scala play framework 2.0.4?
- How to run filter on demand scala play framework
- Intellij, run play framework app in a given port
More Query from same tag
- Stop VFP from showing dialog boxes when errors occur
- Attach a file from HDFS to javax.mail email
- Fields are empty when doing GET in elastic4s
- Structural Operators between graphs
- Unapply/pattern matching with scala macros and quasiquotes for knownDirectSubclasses
- Return instance of inner class in nested classes
- Scala initialize a collection type variable to null outside a for loop and assign some method's return value to the variable inside the loop
- External configuration for Play 2 Framework
- How to include class library in Scala project?
- Is there any advantage to avoiding while loops in Scala?
- Scala: Most concise conversion of a CSS color string to RGB integers
- How can I export scala seq to js.Array in case classes
- Feature extraction from a pre trained model(RSNET-152) in MXNET
- What is wrong with the following inheritance/mix in in Scala?
- Cannot resolve method success.unapply when working with a Future[Unit]
- How to get sum of product from columns in 2 data frame using PySpark
- How to find intersection of 2 dataframes based on multiple columns in spark/scala?
- Is it possible to make scalatest to discover within package object?
- How to run tests with excluded tags in scalatest from maven?
- How can I sort an ArraySeq of List by their second element?
- varargs puzzle?
- how to represent nested JSON object in a case class using Json4s?
- Akka Streams and Scala Play server
- Error: java.lang.NoClassDefFoundError: akka/stream/Fusing$ after update to 2.5.2 Akka version
- How to specify that an abstract method's return type is the subclass's type
- Appium get list items
- Create array of literals and columns from List of Strings in Spark
- Slick and nesting case classes a no go?
- Composing Free monads in Scala
- Issue with scala object companion and trait