Giter Site home page Giter Site logo

hexo-browsersync's People

Contributors

bhamlett-rv avatar curbengh avatar dependabot-preview[bot] avatar dependabot[bot] avatar gaboesquivel avatar mef avatar noahdragon avatar segayuu avatar tcrowe avatar tomap avatar tommy351 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hexo-browsersync's Issues

TypeError: Cannot read property 'indexOf' of undefined

This is what I get using latest versions of hexo, hexo-server and hexo-browsersync.

D:\Repos\celsomiranda.github.io\node_modules\hexo-browsersync\lib\browsersync.js:32
      return ~res.getHeader('Content-Type').indexOf('text/html');
                                           ^
TypeError: Cannot read property 'indexOf' of undefined
    at Object.when (D:\Repos\celsomiranda.github.io\node_modules\hexo-browsersync\lib\browsersync.js:32:44)
    at D:\Repos\celsomiranda.github.io\node_modules\hexo-browsersync\node_modules\connect-injector\lib\connect-injector.js:47:21
    at Function._.each._.forEach (D:\Repos\celsomiranda.github.io\node_modules\hexo-browsersync\node_modules\connect-injector\node_modules\underscore\underscore.js:153:9)
    at ServerResponse.mixin._interceptCheck (D:\Repos\celsomiranda.github.io\node_modules\hexo-browsersync\node_modules\connect-injector\lib\connect-injector.js:46:13)
    at ServerResponse.mixin.end (D:\Repos\celsomiranda.github.io\node_modules\hexo-browsersync\node_modules\connect-injector\lib\connect-injector.js:103:19)
    at ServerResponse.self.(anonymous function) (D:\Repos\celsomiranda.github.io\node_modules\hexo-browsersync\node_modules\connect-injector\node_modules\uberproto\lib\proto.js:61:21)
    at ServerResponse.res.end (D:\Repos\celsomiranda.github.io\node_modules\hexo-server\node_modules\compression\index.js:97:20)
    at SendStream.notModified (D:\Repos\celsomiranda.github.io\node_modules\hexo-server\node_modules\serve-static\node_modules\send\index.js:309:7)
    at SendStream.send (D:\Repos\celsomiranda.github.io\node_modules\hexo-server\node_modules\serve-static\node_modules\send\index.js:516:17)
    at onstat (D:\Repos\celsomiranda.github.io\node_modules\hexo-server\node_modules\serve-static\node_modules\send\index.js:600:10)
    at FSReqWrap.oncomplete (fs.js:78:15)

How do i replace snippet **http://HOST:3000/** to **https://HOST:3000/**

I want to replace http static file server to https. so how to configure?

<script id="__bs_script__">//<![CDATA[
    document.write("<script async src='http://HOST:3000/browser-sync/browser-sync-client.js?v=2.17.5'><\/script>".replace("HOST", location.hostname));
//]]></script>

replace script url scheme to https.

BrowserSync not works with hexo-renderer-jade

I love browsersync and use it to make my own theme, but despite nicely works with hexo-renderer-ejs, I dont have same features with hexo-renderer-jade plugin!

Feature: compile, render and reload on change layout jade file.

Here a repo with two branchs: jade(not works) and ejs(works)

Remember: I only started hexo blog and add/config plugins/themes.

Not working

Hello
I use the hexo3.9 mist theme
I installed and started this way.

Npm install -g browser-sync
Npm install hexo-browsersync --save
Hexo server

But nothing happened
What should I do?

browsersync support for running in dev mode?

hexo-browsersync has to be in dependencies (devDependencies does not work) in package.json for hexo serve to work

"dependencies": {
    "hexo-browsersync": "^0.2.0",
 //...
},
  "devDependencies": {
    "hexo-browsersync": "^0.2.0"
  }

I needed to have it in package.json dependencies, otherwise I wouldn't get the following notification, nor the code injection in the footer.

[BS] Access URLs:
 ----------------------------------
          UI: http://localhost:3001
 ----------------------------------
 UI External: http://10.0.1.16:3001
 ----------------------------------
INFO  Start processing
INFO  Hexo is running at http://localhost:4000/blog/. Press Ctrl+C to stop.

Problem with long pages

I just install hexo and try to use hexo-browsersync. But I notice a bug: when generated page size bigger than some number (~1000 words) it can't be fully loaded, in chrome source code it looks like this:

screen shot 2017-01-20 at 19 05 19

If there is not so much characters in a page, everything is ok. So it happens only in big posts. When I uninstall hexo-browsersync bug is disappear, so it's definitely problem with hexo-browsersync.

I suppose it's could be some stream or buffer limit, but I'm new to node and can't solve this...

CSS Inject

I've tried this:

if(self.route.isModified(path)){
    queue.push(path);
}

in here

but isModified returns that all html files except css file were changed. If we could get this method to work properly, we would also get CSS inject feature working.

Any ideas?

Blank interface?

After running hexo s locally, the interface sometimes appears blank, and it is normal after uninstalling hexo-browsersync! How to solve it?

test environment:

  • MacOS 10.15.3
  • Chrome 80.0.3987.149
  • Hexo 3.9
  • Node 12.16.1

image

Copy the following snippet into your website message ?

I'm getting this message when I run hexo s but adding that snippet is not necessary for browser sync to work.

Copy the following snippet into your website, just before the closing </body> tag
<script type='text/javascript' id="__bs_script__">//<![CDATA[
    document.write("<script async src='http://HOST:3000/browser-sync/browser-sync-client.2.2.3.js'><\/script>".replace("HOST", location.hostname));
//]]></script>

[FEATURE REQUEST] Ability to declare an instance name browsersync to allow external gulp task integration

We run hundreds of sites across various teams and are using Hexo (awesome system by the way) as our SSG combined with our own gulp-based build tools for some additional tasks.

One issue that we have is the ability to trigger browersync's reload command from within our gulp tasks because it cannot be uniquely identified (named,) therefore we can't use bs's native .get(instanceName) command.

If we could update browsersync.js lines 12 -13 to the below, then we could use an entry in the bs settings within hexo.config.json to name the instance, or default it to being unnamed.

var bsConfig = self.config.browsersync || {};
var bsInstanceName = bsConfig.instanceName || '';
var bs = browsersync.create(bsInstanceName);

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.