Giter Club home page Giter Club logo

Comments (20)

f avatar f commented on June 28, 2024

Are you using relative links? Can you try absolute ones?

from atom-html-preview.

smlombardi avatar smlombardi commented on June 28, 2024

i can’t in this case, I was working with a local file. it looks like remote ones from a CDN are working, though.

On Apr 18, 2014, at 7:26 PM, Fatih Kadir AKIN [email protected] wrote:

Are you using relative links? Can you try absolute ones?

β€”
Reply to this email directly or view it on GitHub.

from atom-html-preview.

f avatar f commented on June 28, 2024

Ok, I will work on it πŸ‘

from atom-html-preview.

wayneseymour avatar wayneseymour commented on June 28, 2024

πŸ‘

from atom-html-preview.

Jorval avatar Jorval commented on June 28, 2024

Have the same Problem, worked from a local directory with a css file in it and linked in the html.
css is ignored.
[ Manjaro, Atom 0.94, Html Preview 0.1.3 ]

from atom-html-preview.

azhang avatar azhang commented on June 28, 2024

Yup me too. Atom 0.94. Working for remote css but not local css.

from atom-html-preview.

Red5d avatar Red5d commented on June 28, 2024

Same issue. Local included css/js doesn't work. (Atom 0.100)

from atom-html-preview.

ownadi avatar ownadi commented on June 28, 2024

Same problem here. Does not load images/css.

from atom-html-preview.

alexphelps avatar alexphelps commented on June 28, 2024

Same here, no local css.

from atom-html-preview.

sethfri avatar sethfri commented on June 28, 2024

Same issue, Atom 0.115. Is any fix coming for this soon?

from atom-html-preview.

kwaak avatar kwaak commented on June 28, 2024

After some tinkering I did get local stylesheets and script files to work.

I had to set the sandbox attribute on the IFRAME, and the way source is set.
I used a local filepath as SRC attribute, instead of the data:text/html;charset=utf8, ....

In the package source file atom-html-preview-view.coffee I changed the line

iframe.src = "data:text/html;charset=utf-8,#{encodeURI(text)}"

to

iframe.setAttribute("sandbox", "allow-scripts allow-same-origin")
iframe.src = @getPath()

Changing the source package yourself is pretty easy, while we wait for a update :-)

This pull electron/electron#208 has more info.

from atom-html-preview.

jorng avatar jorng commented on June 28, 2024

I can confirm that @kwaak 's resolution appears to be working. I will continue using it to verify.

from atom-html-preview.

kentonscode avatar kentonscode commented on June 28, 2024

I just used @kwaak suggestion and it works perfectly! Thanks! Now preview shows html+css.

from atom-html-preview.

rixbeck avatar rixbeck commented on June 28, 2024

Thanks @kwaak. It works now like a charm.

from atom-html-preview.

AlexanderMike avatar AlexanderMike commented on June 28, 2024

@kwaak solved similar problem I had with images not displaying

from atom-html-preview.

tirithen avatar tirithen commented on June 28, 2024

Thanks @kwaak it works now, any way to have this implemented in the package as well?

from atom-html-preview.

WebMatt83 avatar WebMatt83 commented on June 28, 2024

@kwaak 's solution isn't working for me. Any suggestions?

from atom-html-preview.

Ajedi32 avatar Ajedi32 commented on June 28, 2024

This doesn't work for me. CSS isn't showing up in Atom, but works fine in Chrome. My link tag is in the html document header and looks like this: <link rel="stylesheet" href="./assets/css/default.css">

from atom-html-preview.

symsmith avatar symsmith commented on June 28, 2024

Works so great, thanks!

from atom-html-preview.

benen89 avatar benen89 commented on June 28, 2024

@kwaak please explain in more details how to fix the issue, Sorry, I'm a beginner so I didn't get what exactly should I do to make Atom Preview read css commends as well. really-Really rely on your help

from atom-html-preview.

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.