cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Chase <>
Subject Remove onDestroy event/channel from cordova-js
Date Mon, 05 Jan 2015 20:27:36 GMT
I'm working on CB-8210, to remove the use of javascript eval()s from native
code in cordova-android.  The goal is to pave the way for CSP.

One usage was to fire the "onDestroy" event when the app is being
destroyed.  However, in my testing, I wasn't able to get this event firing
on the javascript side.  Upon investigation, I discovered that while the
onDestroy is defined for all platforms (in channel.js), it is only
implemented for android.  Further, the code defines it as an internal
event, which should not be used in app code (guidance is to use
window.onunload instead).  I couldn't find any internal code using

Given the above, is there any reason to keep the onDestroy event?  It seems
the simplest thing to do is remove the event, rather than spending more
effort on getting it to work under CSP.  As well, it's defined as an
internal event, so I assume that removal would not be considered an API

I'd welcome any comments for/against removing onDestroy.

Google Cordova team

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message