The Usersnap guys (@fdorfbauer and @josef_trauner) present at ViennaJS what they are doing behind the scenes with their widget and which problems can occur when you develop a widget which will be included in 3rd party sites! The example code is located in our github repo: https://github.com/usersnap/public/tree/master/misc/viennajs