medialab / artoo

artoo.js - the client-side scraping companion.
http://medialab.github.io/artoo/
MIT License
1.1k stars 93 forks source link

atoo.js make js functions crash #261

Closed fgugi closed 7 years ago

fgugi commented 7 years ago

Hi everybody,

I'm currently developing a chrome plugin using artoo.js. In one of the sites where I insert the plugin, artoo.js make crash some js functions. I think It's because artoo.js override the current jquery of the site but I'm not sure. Could you please help me to solve the problem? Although js functions crash the website can not work correctly.

Screenshot console:

image

Yomguithereal commented 7 years ago

Hello @fgugi. Is that on every site on a particular site. If this happens on a particular site can you give me the URL?

fgugi commented 7 years ago

Hello @Yomguithereal ! It's in a partivular site only.

fgugi commented 7 years ago

https://entreprise.pole-emploi.fr/

Yomguithereal commented 7 years ago

I don't succeed in reproducing the error above. How do you do it & can you check without artoo injected to see if the site is not just buggy (because I was able to produce other errors on it without even loading artoo).

fgugi commented 7 years ago

Actually the full url is that one: https://entreprise.pole-emploi.fr/recherche-cv/recherchecv?codeMetier=772

I have checked without artoo.js and the site works fine (no js errors). With artoo.js everytime I click on the site I get errors (I do not use artoo.js methods yet). I could come from my version of jquery. Could you please tell me if you success in reproducing the error please?

Screenshot image

manifest.json

js": [ "shared/js/jquery.min.js", "shared/js/jquery-ui.min.js", "shared/js/artoo.chrome.js",

Yomguithereal commented 7 years ago

I can't reproduce. However, I notice that I have the following message Either jQuery has not a valid version or another library using $ is already present. Correct version available through `artoo.$`. which is different from yours. One thing you can also try is to disable the extension & try the bookmarklet instead and see if you have the same error.

Also, do you have other extensions installed?

fgugi commented 7 years ago

I could try bookmarklet. Thanks. Also I will try to change my jquery version.

I have google cast as well. But I really do not think it's bother the js functions.

Yomguithereal commented 7 years ago

Also I will try to change my jquery version.

I don't understand what you mean. The browser does not have a bundled version of jQuery. Did you change artoo's one?

fgugi commented 7 years ago

What I mean is that the problem could come if artoo remplace the jquery version of the site by his own jquery version _root.$ = artoo.$. But I'm not sure about it.

Not I have not changed artoo's one. Should I try another artoo ?

fgugi commented 7 years ago

Hey @Yomguithereal !!!

Thanks for everything. Actually the problem came from the jquery version the chrome plugin had. I uploaded it to the 2.1.3 version and everything works fine.

Kind regards, Felix