Skip to content

Injection of css files not working in v2.18.11 #1379

@electerious

Description

@electerious

Issue details

I'm using bs.reload('*.css') to trigger the reload of css files. This worked fine with v2.18.8 of browser-sync, but v2.18.11 only updates the first link tag on the site. Switching back to v2.18.8 fixes the issue. I haven't tested v2.18.9 and v2.18.10, yet.

bs.reload() works fine and reloads the whole page.

Another edge case: Browser-sync duplicates the link tag, when the first link tag in the head is a favicon. 1 favicon => First reload => 2 favicons => Another reload => 4 favicons => …

Here's a video of the favicon duplication: https://cl.ly/kVMU

Steps to reproduce/test case

Call bs.reload('*.css') with multiple css files in the head:

<!doctype html>
<html lang="en">
	<head>

		<title>Home | Skeleton</title>

		<meta charset="utf-8">
		<meta name="description" content="">
		<meta name="viewport" content="width=device-width, initial-scale=1">

		<!-- Twitter Cards -->
		<!-- <meta name="twitter:card" content="summary_large_image"> -->
		<!-- <meta name="twitter:site" content="@"> -->

		<!-- Open Graph Protocol -->
		<!-- <meta property="og:type" content="website"> -->

		<!-- Open Graph protocol and Twitter Cards -->
		<!-- <meta property="og:title" content="Home | Skeleton"> -->
		<!-- <meta property="og:description" content=""> -->
		<!-- <meta property="og:image" content="assets/images/og.jpg"> -->

		<!-- CSS -->
		<link rel="stylesheet" href="assets/bower/normalize-css/normalize.css">
		<link rel="stylesheet" href="assets/styles/main.css">
		
		<!-- JS -->
		<script defer src="assets/scripts/main.js"></script>
		
	</head>
	<body>

	</body>
</html>

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

  • Browsersync [ v2.18.11 ]
  • Node [ v7.10.0 ]
  • Npm [ v4.5.0 ]

Affected platforms

  • linux
  • windows
  • OS X
  • freebsd
  • solaris
  • other (please specify which)

Browsersync use-case

  • API
  • Gulp
  • Grunt
  • CLI

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

https://github.com/electerious/Rosid/blob/master/src/deliver.js#L73

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions