CatoAntonsen / MMM-Ruter

MMM-Ruter is a MagicMirror² module for displaying public transport information for Oslo and Akershus (Norway). It's using data from Ruter.no.
MIT License
19 stars 13 forks source link

Access-Control-Allow-Origin #12

Open erikmohn opened 6 years ago

erikmohn commented 6 years ago

Got issues with 'Access-Control-Allow-Origin' errors with this module.

Fixed temporary here with disabling security: /MagicMirror/js/electron.js ->

webPreferences: { webSecurity: false }

kj3rra commented 6 years ago

Hi, my module stopped working last week as well. Just 'Loading'. Is this the reason why? Is there any particular place your text need to go?

If this is just a temporary fix, what is needed to fix it properly?

erikmohn commented 6 years ago

Look in Electron.js where webPreferences is already defined. Add the webSecurity configuration there.

kj3rra commented 6 years ago

Sorry, I cant make that work. Perhaps Im still not putting at the right place. Could you possibly copy in more from the eectron.js so I can see in context?

dagmoen commented 6 years ago

When I did the npm install to install the dependencies it gave me an error on Crypto and said it was deprecated, it might be related?

igundersen commented 6 years ago

Change from http to https on line 192 and 196 in MMM-Ruter.js should solve the problem.

kj3rra commented 6 years ago

Thank you @igundersen! That worked!