Skip to content

[BUG] Breaking change in 2.29 (removed document.write) #2031

Description

@pySilver

In some configurations it is required to append browsersync snippet into <head> instead of <body>. We are doing that in environment where <body> is being swapped during internal navigation. It is typical html-over-the-wire approach for webapps.

What we used to do is leveraging this option https://browsersync.io/docs/options#option-snippetOptions

snippetOptions: {
    rule: {
      match: /<\/head>/i,
      fn: function (snippet, match) {
        return snippet + match;
      },
    },
  },

it worked perfectly. But with 2.29 release it appends an inline script that in turn appends client to <body> which seems to be hardcoded.

Proposed resolution: an option where to append snippet and client.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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