BrowserSync / browser-sync

Keep multiple browsers & devices in sync when building websites. https://browsersync.io
https://discord.gg/2d2xUThp
Apache License 2.0
12.17k stars 756 forks source link

Browsersync wants my <body> #1349

Open F1LT3R opened 7 years ago

F1LT3R commented 7 years ago

Issue details

I find that Browsersync does not get injected automatically when there is not <body> tag is not in the HTML file. With my use-case, I am live-editing lots of HTML partials, which do no contain body tags, so this is awkward to have to inject a <body> tag when the system knows I'm editing a partial, and not inject a <body> tag when I'm loading a full page.

Steps to reproduce/test case

Setup

Install Browsersync as a global package: npm install -g browser-sync

Testing Body Works

Create HTML file: test-working.html

<body>
<h1>Test Working</h1>
</body>

Run the following command and see that Browsersync works: browser-sync start -s --startPath test-working.html

Testing No-Body Fails

Create HTML file: test-broken.html

<h1>Test Broken</h1>

Run the following command and see that Browsersync fails: browser-sync start -s --startPath test-working.html

Demo

I have created a demo here: https://github.com/F1LT3R/browsersync-body-demo

Please specify which version of Browsersync, node and npm you're running

Affected platforms

Browsersync use-case

If CLI, please paste the entire command below

browser-sync start -s --startPath

for all other use-cases, (gulp, grunt etc), please show us exactly how you're using Browsersync

I have created a demo here: https://github.com/F1LT3R/browsersync-body-demo

denis-sokolov commented 7 years ago

Duplicate of #1303.