Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inject script breaks when invoked on https://mochajs.org/ #209

Closed
ghost opened this issue Nov 16, 2016 · 8 comments · Fixed by #220
Closed

Inject script breaks when invoked on https://mochajs.org/ #209

ghost opened this issue Nov 16, 2016 · 8 comments · Fixed by #220
Labels

Comments

@ghost
Copy link

ghost commented Nov 16, 2016

Firefox console report:

firefoxInject.js:12087 -> module is not defines

This is the row:
(function(f,h){"object"===typeof exports?module.exports=h():"function"===typeof define&&define.amd?define(h):f.IPv6=h(f)})(this,function(f){var h=f&&f.IPv6;return{best:function(g){g=g.toLowerCase().split(":");var n=g.length,b=8;""===g[0]&&""===g[1]&&""===g[2]?(g.shift(),g.shift()):""===g[0]&&""===g[1]?g.shift():""===g[n-1]&&""===g[n-2]&&g.pop();n=g.length;-1!==g[n-1].indexOf(".")&&(b=7);var k;for(k=0;k<n&&""!==g[k];k++);if(k<b)for(g.splice(k,1,"0000");g.length<b;)g.splice(k,0,"0000");for(k=0;k<b;k++){for(var n=

Details:
Firefox version 50.0
Also tried on Firefox Developer edition (ver 51.0a2): same error.

@mttwc
Copy link
Contributor

mttwc commented Nov 16, 2016

Hi Rob! Thanks for bringing this up! We're looking into this now.

We're testing the freshly installed extension from the Mozilla addons site on Firefox 50 and it's working fine for us. May we know what sites you are trying to clip? We noticed that the addons site itself would not allow us to invoke the clipper on their page.

@ghost
Copy link
Author

ghost commented Nov 17, 2016

Hi @mttwc you're right!!
The probematic site is https://mochajs.org
In the other sites all works.
Thanks 👍

@larsendaniel
Copy link
Contributor

I get the same on that site with Chrome

@mttwc mttwc changed the title From today Firefox extension not work Inject script breaks when invoked on https://mochajs.org/ Nov 17, 2016
@mttwc
Copy link
Contributor

mttwc commented Nov 17, 2016

Thanks for getting back to us! I can repro the issue on that site as well. I've updated the issue title to reflect this. I'll look into it, but on first sight it looks like the site's JS clashes in some way with our inject script. This is happening in Chrome as well.

@mttwc mttwc added bug and removed high-priority labels Nov 17, 2016
@mttwc
Copy link
Contributor

mttwc commented Nov 17, 2016

After some digging, it's got something to do with requirejs? I'm not fully sure, but I'll play around.
Related: medialize/URI.js#118

@mttwc
Copy link
Contributor

mttwc commented Nov 17, 2016

if (typeof exports === 'object') is incorrectly returning true. 'exports' in this case is actually an HTML h3 element! It's probably being set incorrectly somewhere, so the wrong part of the if-else is being executed.

@mttwc
Copy link
Contributor

mttwc commented Nov 17, 2016

I verified that hardcoding that bit of code to false fixes the issue. Trying to think of a proper fix.

@mttwc
Copy link
Contributor

mttwc commented Nov 17, 2016

I've submitted a PR to the URI.js project that will fix this.

Tracking here
Issue: medialize/URI.js#318
PR: medialize/URI.js#319

Hopefully we'll see it merged soon :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants