try {
var msg = JSON_.parse(json);
} catch (error) {
- xwalk.utils.error('Invalid JSON received: ' + json);
+ // Because of special handling of power lock in chromium, the special signals:
+ // - __DisableChromiumInternalPowerLock
+ // - __EnableChromiumInternalPowerLock
+ // could occur. In such cases we are silently ignroing those messages.
+ // TODO This is workaround for missing patch in chromium-efl package which should handle
+ // this special message and don't forward it to webapi JS. After chromium-efl will
+ // be updated, below checking should be removed.
+ if (json.substring(0,2) === '__') {
+ return;
+ }
+ xwalk.utils.error('Ignoring message - Invalid JSON received: ' + json);
return;
}
var id;