You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently writing a Firefox plugin and wanted to use this library. Using any of the version 0.9.x of Muuri gives me the following error in the console:
Content Security Policy: The page’s settings blocked the loading of a resource at blob:moz-extension://... (“script-src”).
In my case, (using the library for a grid layout) all the items end are sitting in the same location in the top left corner of the grid. They can be dragged around but wherever they are dragged to they just stay there as if there is no attempt being made to layout the items, even when calling grid.layout() nothing happens.
Looking at the changes to the library it looks like in 0.9 muuri started doing layout calculations in web workers when possible. If those web workers are being loaded as blobs, in my case, Firefox will block them for security reasons. When using version 0.8 this problem does not happen, and I'm assuming that it's because the layout is by default calculated synchronously.
Seems to me like the fix would be to offer a manual setting for synchronous or asynchronous layout algorithm (if that already exists, I couldn't find it in the readme), or add a case that accounts for this issue to the fallback logic so that when the web workers are blocked it automatically uses the synchronous layout code.
The text was updated successfully, but these errors were encountered:
wilgaboury
changed the title
Conent Security Policy Issue
Firefox Extention - Conent Security Policy Issue
Aug 18, 2020
Yep, you are 100% correct in your reasoning and gladly there exists an easy way to make Muuri work synchronously. Just run this piece of code once before instantiating any grids.
Muuri.defaultPacker.destroy();
Muuri.defaultPacker = new Muuri.Packer(0);
Currently writing a Firefox plugin and wanted to use this library. Using any of the version 0.9.x of Muuri gives me the following error in the console:
Content Security Policy: The page’s settings blocked the loading of a resource at blob:moz-extension://... (“script-src”).
In my case, (using the library for a grid layout) all the items end are sitting in the same location in the top left corner of the grid. They can be dragged around but wherever they are dragged to they just stay there as if there is no attempt being made to layout the items, even when calling grid.layout() nothing happens.
Looking at the changes to the library it looks like in 0.9 muuri started doing layout calculations in web workers when possible. If those web workers are being loaded as blobs, in my case, Firefox will block them for security reasons. When using version 0.8 this problem does not happen, and I'm assuming that it's because the layout is by default calculated synchronously.
Seems to me like the fix would be to offer a manual setting for synchronous or asynchronous layout algorithm (if that already exists, I couldn't find it in the readme), or add a case that accounts for this issue to the fallback logic so that when the web workers are blocked it automatically uses the synchronous layout code.
The text was updated successfully, but these errors were encountered: