Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

Content security policy #345

Closed
Closed
@MrCrimp

Description

@MrCrimp

The following files where reported from content security policy checking
domain-task/fetch.js

Inline eval() and functions() are not compliant with content security policy
var isBrowser = (new Function('try { return this === window; } catch (e) { return false; }'))();

This is how I'd do the same test

export const isNode = (typeof process === 'object' && Object.prototype.toString.call(process) === '[object process]');
export const isBrowser = !isNode && Object.prototype.toString.call(window) === '[object Window]';

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions