reading-time icon indicating copy to clipboard operation
reading-time copied to clipboard

avoid script execution if remote is a full HTML page

Open Cerdic opened this issue 10 years ago • 2 comments

TODO : need improvement if script in body part of the page

Cerdic avatar Nov 13 '14 15:11 Cerdic

Is this necessary? I haven't tested the plugin using a remote page that includes a script but I don't think it should matter, because the remoteTarget will limit the content to the specified element. Can anyone confirm this?

michael-lynch avatar Dec 08 '14 22:12 michael-lynch

The problem is that setTime($('<div>').html(data) make all scripts tags of remote page data beeing executed. My use case is indicating reading time of "next article", so the remote page is a full HTML page embeding jQuery as the current one. Thus jQuery is overriden with a new instance and this broke some scripts that had a kept some reference to jQuery or some if it's methods.

Cerdic avatar Dec 09 '14 07:12 Cerdic