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

linkHrefJS feature test appears to be causing problems in IE9 and IE10 (+ Karma?) #105

Open
timwienk opened this issue Sep 26, 2015 · 2 comments
Labels

Comments

@timwienk
Copy link
Contributor

Situation:

For our testing we've used a pretty old version of syn (or, back then, Syn) until now. When trying to update this, we run into problems with IE9 and IE10.

I've dumbed the test environment down to just loading Karma and syn. What happens in IE9 and IE10 is that right after starting, Karma errors with "Some of your tests did a full page reload!" and stops. In IE7, IE8, IE11 and Edge everything works as expected.

After some attempts to track down the problem, I found out that this problem stops occuring when the feature test for linkHrefJS is removed. I'm not entirely sure what's going on here, but it appears that triggering a click on <a href="javascript:__synthTest()"> causes the page to reload in IE9 and IE10. The __synthTest function doesn't even get executed.

I wasn't able to determine whether this problem is related to Karma being loaded or if it's an actual compatibility problem with IE9 and IE10, but since this feature test was fixed in December 2013 (#17) I kind of assume this isn't a generic issue in these browsers.

How to reproduce:

I'd say any environment with at least Karma and syn. But I'll describe my dumbed down test environment below, assuming node and npm installed:

mkdir syn-test
cd syn-test
npm install karma syn
cat << EOF > karma.conf
module.exports = function(config){
    config.set({
        files: ['node_modules/syn/dist/syn.js']
    });
};
EOF
`npm bin`/karma start karma.conf

That starts a karma server at http://localhost:9876/.
Opening that in any browser should error "You need to include some adapter that implements __karma__.start method!" (since we didn't actually add anything to start).
In IE9 and IE10 this errors "Some of your tests did a full page reload!".

@justinbmeyer
Copy link
Member

Thanks. I suppose we need to add karma as a test runner for our test script (and probably get IE automatically tested (instead of the manual testing that happens now (we test FF only for CI) ).

@SergioCrisostomo
Copy link
Contributor

One idea could be to do that feature check inside a iFrame, loading the HTML string and firing the trigger to that <a href="javascript:__synthTest()"> inside a iFrame. If the iFrame reloads it will not run syn.support.linkHrefJS = true; and the feature check is done anyway by omission.

The iFrame idea would bring a new async aspect, forcing these triggers and syn.support.ready++; to wait for the iframe.onload event. Its a idea, not sure how the rest of loading syn would be affected. It prevented the unwanted reload in IE9/10 in my testing but might break other things.

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

No branches or pull requests

3 participants