Политика безопасности контента, веб-работники и Messenger Instant Games - PullRequest
0 голосов
/ 13 мая 2019

Я пытаюсь опубликовать свою пятую игру для Messenger Instant Games, она основана на Canvas и содержит веб-работников, URL: https://fb.gg/play/mballoons-instant

К сожалению, в Firefox я получаю следующие ошибки:

Content Security Policy: The page’s settings blocked the loading of a resource at https://apps-358163598249220.apps.fbsbx.com/instant-bundle/1811672228944054/2603592899715750/scripts/storage.js (“object-src”).
Content Security Policy: The page’s settings blocked the loading of a resource at https://apps-358163598249220.apps.fbsbx.com/instant-bundle/1811672228944054/2603592899715750/scripts/sizzle.js (“object-src”).
Content Security Policy: The page’s settings blocked the loading of a resource at https://apps-358163598249220.apps.fbsbx.com/instant-bundle/1811672228944054/2603592899715750/scripts/dom.js (“object-src”).
Content Security Policy: The page’s settings blocked the loading of a resource at https://apps-358163598249220.apps.fbsbx.com/instant-bundle/1811672228944054/2603592899715750/scripts/requestAnimationFrame.js (“object-src”).
Content Security Policy: The page’s settings blocked the loading of a resource at https://apps-358163598249220.apps.fbsbx.com/instant-bundle/1811672228944054/2603592899715750/scripts/game.js (“object-src”).
Content Security Policy: The page’s settings blocked the loading of a resource at https://apps-358163598249220.apps.fbsbx.com/instant-bundle/1811672228944054/2603592899715750/scripts/screen.splash.js (“object-src”).
Content Security Policy: The page’s settings blocked the loading of a resource at https://apps-358163598249220.apps.fbsbx.com/instant-bundle/1811672228944054/2603592899715750/scripts/display.canvas.js (“object-src”).
Content Security Policy: The page’s settings blocked the loading of a resource at https://apps-358163598249220.apps.fbsbx.com/instant-bundle/1811672228944054/2603592899715750/scripts/board.worker-interface.js (“object-src”).
Content Security Policy: The page’s settings blocked the loading of a resource at https://apps-358163598249220.apps.fbsbx.com/instant-bundle/1811672228944054/2603592899715750/scripts/board.worker.js (“object-src”).
Content Security Policy: The page’s settings blocked the loading of a resource at https://apps-358163598249220.apps.fbsbx.com/instant-bundle/1811672228944054/2603592899715750/scripts/audio.js (“object-src”).
Content Security Policy: The page’s settings blocked the loading of a resource at https://apps-358163598249220.apps.fbsbx.com/instant-bundle/1811672228944054/2603592899715750/scripts/input.js (“object-src”).
Content Security Policy: The page’s settings blocked the loading of a resource at https://apps-358163598249220.apps.fbsbx.com/instant-bundle/1811672228944054/2603592899715750/scripts/screen.highscore.js (“object-src”).
Content Security Policy: The page’s settings blocked the loading of a resource at https://apps-358163598249220.apps.fbsbx.com/instant-bundle/1811672228944054/2603592899715750/scripts/screen.main-menu.js (“object-src”).
Content Security Policy: The page’s settings blocked the loading of a resource at https://apps-358163598249220.apps.fbsbx.com/instant-bundle/1811672228944054/2603592899715750/scripts/screen.game.js (“object-src”).
Content Security Policy: The page’s settings blocked the loading of a resource at https://apps-358163598249220.apps.fbsbx.com/instant-bundle/1811672228944054/2603592899715750/images/balloons.png (“object-src”).

Мне кажется, проблема в строке worker = new Worker("scripts/board.worker.js") в следующем файле https://apps -358163598249220.apps.fbsbx.com / instant-bundle / 1811672228944054/2603592899715750 / scripts /board.worker-interface.js? fbclid = IwAR0wHv196GjTXmK1yTw02-JHIrxiG2xl_YMmxpGMzZqkNaO7J9HVsGWijv4

Я пытался решить эту проблему, используя следующий ответ, но не из 1014 * 1013, пытаясь решить эту проблему, но не смог * *,Буду признателен за любую помощь, это старая игра, но она просто хотела развернуть ее.

Если вы загрузите всю игру, то запустив index.html в Chrome, вы увидите

Uncaught DOMException: Failed to construct 'Worker': Script at '[FILE URI]' cannot be accessed from origin 'null'.

Я знаю, что это связано с тем, что он запускается на локальном компьютере с file:///, хотя проблема заключается в том, что однажды приложение на сервере, но, возможно, это мог быть любой совет.

Пока Firefoxна локальном компьютере (также с использованием file:///) отображаются предупреждения, по-прежнему позволяющие играть в игру:

The character encoding of a framed document was not declared. The document may appear different if viewed without the document framing it. storage.js
The character encoding of a framed document was not declared. The document may appear different if viewed without the document framing it. 
...

Для всех файлов, загруженных Modernizr.Интересно то, что при упаковке в Cordova я смог опубликовать на Android, но на iOS нет.На iOS у меня та же проблема, что и с Messenger, игра только загружается и появляется черный экран.В запущенном консольном журнале он видит ошибки о CSP.

...