as-ideas / oil

191 stars 56 forks source link

Promises and Internet Explorer #146

Closed kleins closed 6 years ago

kleins commented 6 years ago

Hi there -

what about Internet Explorer Support?

Internet Explorer always prints this line to console:

Unhandled promise rejection TypeError: Das Objekt unterstützt die Eigenschaft oder Methode “assign” nicht

MDN shows no Support for any Internet Explorer Version.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise

Is there a workaround or something like that?

Thanks in advanced.

Sascha

phogel commented 6 years ago

Hey thanks for asking. Working on it right now. Will let you know when the fix is up👍

kleins commented 6 years ago

Thanks for the reply. What will be your solution? I've read something about Polyfill which should help to solve this Problem. Polyfill was also available in version 1.1.0. But with Polyfill we had some problems on some sites which also implemented Polyfill.

Thanks

phogel commented 6 years ago

We removed the babel-polyfill because it interfered with some of our sites, too. Promise is polyfilled but the new error you're seeing is from inside the ConsentString library – Object.assign is used but not polyfilled. Now we're going to load the polyfills dependent on whether the browser provides them natively or not. You can view my current implementation state here: https://github.com/as-ideas/oil/blob/oil-190-browserstacks/src/polyfill.js

phogel commented 6 years ago

The fix has been merged with #150

kleins commented 6 years ago

thank you for your reply. I've checkt the merge and sadly it didn't work as expected. In IE 9 I get a similar error (see Screenshot), but consent layer is displayed as expected.

In IE 10 __cmp callback function would not called:

__cmp('getVendorConsents', null, function (result) {
    // The callback is never called
    my_lib.consent_given = true;
});

So consent wouldn't given.

This behaviour also happen in IE 9.

IE 11, seems to work as expected. Consent the callback is called and consent is given dashboard 2018-06-25 14-51-05

phogel commented 6 years ago

The fill method will be polyfilled in the next release. See this PR #154 Will write a seperate test for getVendorConsents on IE10

Waschnick commented 6 years ago

With Version 1.2.1 there should be no issues.