krux / postscribe

Asynchronously write javascript, even with document.write.
MIT License
986 stars 156 forks source link

Two instances of postscribe at the same time? #469

Open dirkholzapfel opened 6 years ago

dirkholzapfel commented 6 years ago

We use postscribe to dynamically show ads. An AdManager we use (http://admanager.pushfire.de/admanager.js) has postscribe included (see line 389) on its own.

With this setup we get errors like postscribe.js?e558:170 Uncaught Error: Bad script nesting or script finished twice.

I would like to know if postscribe is supposed to work under these circumstances?

giannoudak commented 6 years ago

hi, i am having the same issue? is there any update on this?

@dirkholzapfel have you managed to find a solution/workaround?

Thanks in advance

dirkholzapfel commented 6 years ago

@giannoudak becaue of the way pushfire included postscribe http://admanager.pushfire.de/admanager.js (see line 431) we were able to work around like this:

import postscribe from 'postscribe'
window.postscribe = postscribe

that way pushfire uses our postscribe version. and that's also a problem - as soon as we use incompatible versions - this won't work anymore.