awulder / angular-prismicio

AngularJS service for prismic.io
MIT License
32 stars 15 forks source link

Browser support (Internet Explorer 8/9)? #22

Open Tailzip opened 9 years ago

Tailzip commented 9 years ago

Hey,

What's the browser support for this angular module? Currently, I can't make it work on IE9. I'm getting a (very explicit...) error in the console :

Error: Access is denied.

The Prismic.io JS SDK supports IE9+ : https://github.com/prismicio/javascript-kit/issues/20

Any help appreciated!

Thanks!

dlecan commented 9 years ago

No problem for me on IE8. How do you you know it comes from angular-prismicio ?

Tailzip commented 9 years ago

Whenever I remove angular-prismicio code, I don't get that error.

I've set the config into my main app.js file :

 PrismicProvider.setApiEndpoint('https://xxxx.prismic.io/api');
 PrismicProvider.setAccessToken('xxxxxxx');
 PrismicProvider.setClientId('xxxxxxxx');
 PrismicProvider.setClientSecret('xxxxxxx');
 PrismicProvider.setLinkResolver(function(ctx, doc) {
  return 'detail.html?id=' + doc.id + '&slug=' + doc.slug + ctx.maybeRefParam;
 });

And I simply have that code to check if it's working in my controller :

Prismic.api().then(function(api) {
 console.log(api);
});

When I add this code, I got the error "Access is denied", when I remove it, I don't get that error.

EDIT : I'm using Angular 1.2.6

Thanks!

Tailzip commented 9 years ago

UPDATE : looks like I had to add my domain name to "Trusted sites" list on IE, and use http over https when hitting Prismic.io api. Now it's working, on IE9!

Have anyone ever encountered that issue?

Thanks!

Tailzip commented 9 years ago

:up:

dlecan commented 9 years ago

Internet Explorer (8/9 ...) has many limitations when doing cross-domain ajax requests.

It has nothing to do with angular-prismicio and Javascript provided by this module is compatible with IE8 and more.

awulder commented 9 years ago

There could be an issue with IE8 because the directive used is restricted to element. The directive should also be used as an attribute (A). Actually I'm thinking about upgrading all the dependencies to the latest and Angular to 1.3.x. That means that IE8 support is dropped.

Can I close this issue?

awulder commented 9 years ago

The prismicHtml directive can now also be used as an attribute. That would solve some IE8 issues.