Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

No default body tag. #3

Closed
mini-eggs opened this issue Jun 14, 2017 · 3 comments
Closed

No default body tag. #3

mini-eggs opened this issue Jun 14, 2017 · 3 comments

Comments

@mini-eggs
Copy link

Found a nice edge case for ya 馃棥

Opening:

<link href="https://fonts.googleapis.com/css?family=Lilita+One" rel="stylesheet">

<style>
  html {
    background-color: #f1f1f1;
    font-family: 'Lilita One', cursive;
    animation-duration: 5000ms;
    animation-fill-mode: both;
    animation-iteration-count: infinite;
    backface-visibility: visible;
    animation-name: colors;
    animation-timing-function: linear;
  }

  @keyframes colors {
    0% {
      transform: rotate3d(0deg);
      background-color: #f10a75;
      color: #fed024;
    }
    50% {
      background-color: #fed024;
      color: #f10a75;
    }
    100% {
      transform: rotateY(360deg);
      background-color: #f10a75;
      color: #fed024;
    }
  }

  body {
    margin: 0;
    text-align: center;
    line-height: 100vh;
  }

  body:after {
    content: "Coming Soon";
    font-size: 5vh;
  }
</style>

will display a spinning loading message, while after it has been ran through staticrypt it will not due to no default body tag being generated.

@robinmoisson
Copy link
Owner

robinmoisson commented Jun 15, 2017

@mini-eggs Do you mean you encrypted that snippet and when you unlock it it behaves differently than if you open your snippet directly with a browser?

A full html page is expected (with html and body tags) to be decrypted then loaded correctly in browser, if you just use a fragment you might encounter different display behaviors. Most browsers try to fix HTML with missing tags on page first loading time but you shouldn't really rely on it.

@mini-eggs
Copy link
Author

Do you mean you encrypted that snippet and when you unlock it it behaves differently than if you open your snippet directly with a browser?

Yes.

This is pretty up in the air to fix since it's not a best practice to rely on browsers fixing broken HTML, just thought it would be interesting to throw your way. If this tool requires/expects there to be valid HTML the no issue here

@robinmoisson
Copy link
Owner

If broken HTML is required for this issue to show up this feels slightly too edgy to me, people are a bit responsible for the display of what they encrypt :) Since the placeholder starts with <html><head>... it should be clear we expect all tags.

If you have a simple fix in mind feel free to open a PR and I'll look into it. Meanwhile I'm closing for now, thanks for testing and reporting !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants