Git Product home page Git Product logo

Comments (11)

anselmh avatar anselmh commented on June 17, 2024

Can be manually fixed by site authors:

p.s. I fixed the security problem by avoiding @import and setting a header in PHP:
header('Access-Control-Allow-Origin:*');
then adding the crossorigin attribute to the <link crossorigin="use-credentials"

respectively setting it in the .htaccess file.
We should still try to fix this in our script or it needs to be documented but this is the short fix.

ccing @mattbbp

from object-fit.

anselmh avatar anselmh commented on June 17, 2024

I researched a bit more and found out we could only fix this by circumventing the CSSOM CORS. This is a massive hack which I don’t think should land in our codebase as it has too many side effects.

Therefore I’ll rename the issue as it only needs to be documented.

from object-fit.

lolmaus avatar lolmaus commented on June 17, 2024

Hi! I receive "SecurityError: The operation is insecure." even though i'm bundling polyfill.object-fit.js with a relative URL.

Is there something i can do to solve it?

from object-fit.

anselmh avatar anselmh commented on June 17, 2024

Is there any SSL involved or a different port / host?

from object-fit.

lolmaus avatar lolmaus commented on June 17, 2024

No SSL.

The web server is running in a virtualbox, serving all assets locally (i. e. with relative paths). I'm opening it in browser as http://foo:3000.

from object-fit.

lolmaus avatar lolmaus commented on June 17, 2024

PS Firefox.

from object-fit.

anselmh avatar anselmh commented on June 17, 2024

So, are you using Webfonts that are from a 3rd party, by chance? Somewhere there must be another host / protocol involded to trigger this issue as far as I know. It’s very annoying but this these are the circumstances we’re dealing with when using JS (and we can’t use anything else here) nowadays for such stuff.

from object-fit.

lolmaus avatar lolmaus commented on June 17, 2024

I do use web fonts served from an external URL. I thought only the fitted images are concerned...

from object-fit.

anselmh avatar anselmh commented on June 17, 2024

Okay, then this is the issue. Unfortunately, as the polyfill needs to read out your computed CSS it does exactly that. And this means all inherited properties and values, such as fonts as well. I’m not sure if that is somehow avoidable, I have a look at this specific GetMatchedCSSRules.js anyways as it causes major problems and performance issues as well.

from object-fit.

anselmh avatar anselmh commented on June 17, 2024

By the way this should not affect your live setup when protocols and ports match (=non mixed content, so HTTP or HTTPS only).

from object-fit.

luruke avatar luruke commented on June 17, 2024

I had a similar problem like @lolmaus (I was using typekit)

I solved adding this code inside getSheetRules():

if (stylesheet.href && stylesheet.href.match(/typekit/)) {
            return [];
}

from object-fit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.