ftguy2018 Posted September 20, 2018 Share Posted September 20, 2018 @enpu Hi, We have a chrome extension which is crashing when executed from a panda2 game but apparently the same extension works correctly when not...so could it be possible that the panda2 engine is doing something to the postMessage function which is crashing ? Uncaught DOMException: Failed to execute 'postMessage' on 'Window': function(item) { for (var i = this.length; i >= 0; i--) { if (this === item) { ...<omitted>... } could not be cloned. at i._write (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/inpage.js:1:113048) at v (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/inpage.js:1:131903) at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/inpage.js:1:135015 at i.g.write (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/inpage.js:1:135042) at e.exports.y (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/inpage.js:1:124283) at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/inpage.js:1:35213 at e.exports.a.emit (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/inpage.js:1:35283) at w (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/inpage.js:1:119122) at _ (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/inpage.js:1:118937) at e.exports.b.push (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/inpage.js:1:119748) Quote Link to comment Share on other sites More sharing options...
enpu Posted September 20, 2018 Share Posted September 20, 2018 There is nothing done on postMessage in Panda engine. So are you trying to run Chrome extension inside Panda editor? Quote Link to comment Share on other sites More sharing options...
ftguy2018 Posted September 22, 2018 Author Share Posted September 22, 2018 No I am trying to call a function provided by that chrome extension, that chrome extension is injecting a javascript object and apparently it breaks, I will try to make a simple project with the bare minimum and see, maybe some of the plugin is doing something.... Quote Link to comment Share on other sites More sharing options...
ftguy2018 Posted September 22, 2018 Author Share Posted September 22, 2018 @enpu Unfortunately this is the engine breaking the extension on chrome Version 69.0.3497.100 (Official Build) (64-bit) and Metamask extension 4.10.0, it is a major extension used by the Ethereum dapp community which is injecting a web3 object in every page, I made a little repro-code, main-direct.js is working, the same code into the regular engine main.js is breaking, this is an important matter because it breaks not only our website but eventually all website using this popular extension so I hope to see this fixed as a matter of urgency, thank you again for your support. main-direct.js main.js Quote Link to comment Share on other sites More sharing options...
ftguy2018 Posted September 22, 2018 Author Share Posted September 22, 2018 Maybe it could help but by adding the following at the top of the main.js , it is working, basically trying to hook the window.postMessage on chrome : try { var postMessageTemp = window.postMessage; window.postMessage = function(message, targetOrigin, transfer) { postMessageTemp(JSON.parse(JSON.stringify(message)), targetOrigin, transfer) }; } catch(err) { } Quote Link to comment Share on other sites More sharing options...
ftguy2018 Posted September 25, 2018 Author Share Posted September 25, 2018 @enpu For your information, It is also confirmed by the developer of the extension https://github.com/MetaMask/metamask-extension/issues/5333 so I will use temporary the fix I made thought I am not sure why the 'game' class is activating this bug thought it might be connected with array.prototype. Quote Link to comment Share on other sites More sharing options...
enpu Posted September 28, 2018 Share Posted September 28, 2018 Hi @ftguy2018 So did you get this working? Quote Link to comment Share on other sites More sharing options...
ftguy2018 Posted October 1, 2018 Author Share Posted October 1, 2018 @enpu Yes, actually after I reported the issue they managed to update their extension and it seems to work now ^^ Wolfsbane 1 Quote Link to comment Share on other sites More sharing options...
enpu Posted October 1, 2018 Share Posted October 1, 2018 That's great news! ftguy2018 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.