[p2pu-dev] plugins.js and document.write()

Paul Osman paul at eval.ca
Tue Aug 7 17:07:00 UTC 2012


Looks like it's a security thing. You're meant to replace 'docwriteregexwhitelist' with a regular expression that allows specific 3rd party scripts to use document.write(). Take a look at the following issue filed by someone who was similarly confused: 

https://github.com/h5bp/html5-boilerplate/issues/150

Interestingly, recent versions of boilerplate don't include this. 

Cheers,
-P


On Tuesday, 7 August, 2012 at 6:52 AM, Dan Diebolt wrote:

> I think the code serves as a debugging aid to intercept document.write calls and store them in the array log.history as well as echo to console.log. I don't think the code was intended for inclusion in production.
> 
> On Tue, Aug 7, 2012 at 4:23 AM, Dirk Uys <dirk at p2pu.org (mailto:dirk at p2pu.org)> wrote:
> > Hi everyone, Paul, Zuzel
> > 
> > After some focused debugging on why conversion tracking isn't working (Iow, after I verified a 100 times that the code is correct and accepted that it still doesn't work) I found the problem or at least what I think is the problem:
> > 
> > It seems like in plugins.js (https://github.com/p2pu/lernanta/blob/master/lernanta/static/js/plugins.js#L47) essentially disables document.write().  Except if you want to write "docwriteregexwhitelist". It looks like this comes from HTML 5 Boilerplate? What was the reasoning behind this - is this to stop other JavaScript from doing bad things? Doesn't embed.ly (http://embed.ly) already do this? Or do we allow script tags in the rich text editor?
> > 
> > I would like to get conversion tracking to work on the site, so can I safely remove this bit of code?
> > 
> > Cheers
> > Dirk
> > 
> > _______________________________________________
> > p2pu-dev mailing list
> > p2pu-dev at lists.p2pu.org (mailto:p2pu-dev at lists.p2pu.org)
> > http://lists.p2pu.org/mailman/listinfo/p2pu-dev
> > 
> 
> _______________________________________________
> p2pu-dev mailing list
> p2pu-dev at lists.p2pu.org (mailto:p2pu-dev at lists.p2pu.org)
> http://lists.p2pu.org/mailman/listinfo/p2pu-dev
> 
> 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p2pu.org/pipermail/p2pu-dev/attachments/20120807/1054a2e9/attachment.html>


More information about the p2pu-dev mailing list