keras-js icon indicating copy to clipboard operation
keras-js copied to clipboard

require keras.js in tampermonkey/userscript/greasymonkey

Open n0whereRuoxi opened this issue 7 years ago • 0 comments

I am trying to use keras.js in my tampermonkey userscript

// ==/UserScript==
// @require https://github.com/transcranial/keras-js/blob/master/dist/keras.js
// ==/UserScript==

but here comes the error:

Syntax error @ "Slither.io Bot Championship Edition"!
##########################
JSHINT output:
require: (E030) Expected an identifier and instead saw '<' on line: 8 at character: 1
require: (E033) Expected an operator and instead saw '!' on line: 8 at character: 2
require: (W030) Expected an assignment or function call and instead saw an expression on line: 8 at character: 2
require: (E058) Missing semicolon on line: 8 at character: 3
require: (W030) Expected an assignment or function call and instead saw an expression on line: 8 at character: 3
require: (E058) Missing semicolon on line: 8 at character: 10
require: (E030) Expected an identifier and instead saw '<' on line: 9 at character: 1
require: (E041) Unrecoverable syntax error. (0% scanned) on line: 9 at character: 1
##########################

SyntaxError: Unexpected token <
    at eval (<anonymous>)
    at <anonymous>:2:398
    at Object.b [as F_c] (<anonymous>:2:243)
    at Object.E_u (<anonymous>:3:66)
    at u (eval at exec_fn (:1:108), <anonymous>:60:208)
    at E (eval at exec_fn (:1:108), <anonymous>:58:458)
    at Object.create (eval at exec_fn (:1:108), <anonymous>:67:51)
    at e (eval at exec_fn (:1:108), <anonymous>:15:238)

Notice that it worked well when I used // @require http://code.jquery.com/jquery-latest.js

So what is the proper way to do that?

n0whereRuoxi avatar Jun 29 '17 05:06 n0whereRuoxi