Skip to content
This repository has been archived by the owner on Nov 15, 2017. It is now read-only.

Inline script tags not reported in matrix under certain conditions #413

Open
gorhill opened this issue Sep 16, 2014 · 0 comments
Open

Inline script tags not reported in matrix under certain conditions #413

gorhill opened this issue Sep 16, 2014 · 0 comments

Comments

@gorhill
Copy link
Owner

gorhill commented Sep 16, 2014

Test case: https://news.ycombinator.com/.

Conditions:

  • Scripts allowed by default in matrix
  • No 3rd-party scripts on the page

The problem is this piece of code in contentScriptSummaryHandler() in https://github.com/gorhill/httpswitchboard/blob/master/js/messaging-handlers.js:

if ( pageStats && inlineScriptBlocked ) {
    urls = details.scriptSources;
    for ( url in urls ) {
        if ( !urls.hasOwnProperty(url) ) {
            continue;
        }
        if ( url === '{inline_script}' ) {
            url = frameURL + '{inline_script}';
        }
        r = httpsb.filterRequest(pageURL, 'script', url);
        pageStats.recordRequest('script', url, r !== false, r);
    }
}

Inline script tags should always be counted, even if inlineScriptBlocked is false. inlineScriptBlocked needs to be used to filter out 3rd-party scripts to avoid counting them twice.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant