W3C home > Mailing lists > Public > public-webapps@w3.org > July to September 2012

Re: [Workers] Worker same-origin and usage in JS libraries...

From: Bronislav Klučka <Bronislav.Klucka@bauglir.com>
Date: Wed, 18 Jul 2012 01:20:14 +0200
Message-ID: <5005F32E.4020107@bauglir.com>
To: public-webapps@w3.org

On 18.7.2012 1:05, Ian Hickson wrote:
>> And if you want it to be defined in JS file itself, I'll suggest "use
>> strict" approach:
>> file> ---------------------------------------------------------------
>> "Access-Control-Allow-Origin: *";
>> (function(){
>>      "use strict";
>>        var x = 5;
>> })();
>> ---------------------------------------------------------------<file
> Whether it's a string or a comment seems like a detail. If we do do this,
> I expect we'll find something that's somewhat language-agnostic (e.g.
> allowing any leading and trailing punctuation on the first line, or
> something to that effect).
Well not exactly a detail... we already have comment processing in HTML 
and JS... (IE). Script minifiers can have issues with that, JS engines 
would have to start parse end somehow execute comments to look for 
something suspicious in a text without recognizable syntax and semantics 
Maybe some specific object, as a property on window / worker scope would 
be inline with language and requiremenets (=to define script properties)
(this|self).ScriptProperties = {
    DisableCrossOriginExecution = false, //to disable CO script sharing, 
since current default is true
    AllowCrossOriginWorkerExecution = true //to enable CO in workers, 
since current default is false

it would also allow any future extensions

Received on Tuesday, 17 July 2012 23:20:43 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:13:37 UTC