The following forum(s) are migrating to a new home on Microsoft Q&A (Preview): Developing Universal Windows apps!

Ask new questions on Microsoft Q&A (Preview).
Interact with existing posts until December 13, 2019, after which content will be closed to all new and existing posts.

Learn More

 none
Error: Resource violated directive in Host Defined Policy: inline script RRS feed

  • Question

  • Hello all,

    I am porting my company's XboxOne app over to the UWA platform, and one of the issues I'm running into is related to running scripts in the HTML that were defined in the Javascript.

    For example:

    In the JS I have something like:

    WinJS.Namespace.define("Application.View", {
        callback: function() {
            console.log('do some work');
        }
    });
    

    And the HTML looks something like:

    <div class="foo" onclick="Application.View.callback()">
        <button>Click me!</button>
    </div>

    Here is the error, as I see it in the JavaScript console:

    CSP14312: Resource violated directive 'script-src ms-appx: data: 'unsafe-eval'' in Host Defined Policy: inline script. Resource will be blocked.

    I should note that I was NOT seeing this error in our XboxOne app, and am only seeing it now as I have ported over to Windows 10 UAP. Does anyone have any insight as to how I can change this "Host Defined Policy"? Perhaps in the App Manifest?

    Thanks!

    Thursday, June 11, 2015 6:26 PM

All replies