简体   繁体   中英

Chrome console shows Uncaught TypeError: Cannot read property 'start' of undefined

I've created extension and ported it for all browsers. My extension adds buttons above one of Georgian forum's textarea

http://i.imgur.com/5gjIE.png

But I have strange problem only with Google Chrome and Safari. If you click exactly on blue image (B) there is no error but if you click anywhere else on that button it shows Uncaught TypeError: Cannot read property 'start' of undefined error in console and automatically posts on that web-site.

Here is my extension's source http://pastebin.com/mxnBqDxS

Console shows that error is on 341 line var replaced = wrapper.start+val.substring(start, end)+wrapper.end;

Do you have any ideas why is this happening? Thanks

Well the problem is here:

var method = ev.target.parentNode.id;
var wrapper = this._WRAPPERS[method];

wrapper is not getting set which means that _WRAPPERS[method] does not exist. You could put an alert in to show the value of method -- my guess is that would make the problem clear.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM