jaxbot / browserlink.vim

Live browser editing for Vim
MIT License
711 stars 38 forks source link

Step by step guide for adding userscript to Chrome and/or Firefox #28

Closed gryftir closed 10 years ago

gryftir commented 10 years ago

Still having issues adding a user script to chrome for brolink to render. Would love a step by step guide.

jaxbot commented 10 years ago

I'll add this to the README in a bit, but basically:

  1. Install Tampermonkey from the Chrome App Store
  2. Within Tampermonkey, add a new script with these contents:
// ==UserScript==
// @name       My Fancy New Userscript
// @namespace  http://use.i.E.your.homepage/
// @version    0.1
// @description  enter something useful
// @match      http://127.0.0.1:8080/*
// @match      http://localhost:8080/*
// @match      http://localhost:8300/*
// @copyright  2012+, You
// ==/UserScript==

var s = document.createElement("script");
s.src= "http://127.0.0.1:9001/js/socket.js";
document.body.appendChild(s);
jaxbot commented 10 years ago

Replace the @matches with whatever your local server happens to be

gryftir commented 10 years ago

I ended up going with the following instead of those @match ones, and finally got it working. // @include http://127.0.0.1:80 //@include http://localhost:80 //@include http://localhost:80_/_ // @include http://127.0.0.1:80/

About Me: http://about.me/lawrencesiebert Constantly Coding: http://constantcoding.blogspot.com

On Wed, Sep 3, 2014 at 4:57 AM, Jonathan Warner notifications@github.com wrote:

Replace the @matches https://github.com/matches with whatever your local server happens to be

— Reply to this email directly or view it on GitHub https://github.com/jaxbot/browserlink.vim/issues/28#issuecomment-54285844 .

jaxbot commented 10 years ago

Awesome, can I close this?

gryftir commented 10 years ago

Sure

About Me: http://about.me/lawrencesiebert Constantly Coding: http://constantcoding.blogspot.com

On Wed, Sep 3, 2014 at 6:43 AM, Jonathan Warner notifications@github.com wrote:

Awesome, can I close this?

— Reply to this email directly or view it on GitHub https://github.com/jaxbot/browserlink.vim/issues/28#issuecomment-54298378 .