Fix cross frame Date instanceof problem

When a date object is created in another frame, instanceof Date
doesn't return true. To solve this, we inject the Date function
into the device iframe.