| 1 | <?php |
||
| 15 | class Browser |
||
| 16 | { |
||
| 17 | /** |
||
| 18 | * @var \Kenjis\Csp\Browser\AdapterInterface |
||
| 19 | */ |
||
| 20 | private $browserDetector; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * List of browsers and versions which support CSP nonce-source |
||
| 24 | * |
||
| 25 | * @var array |
||
| 26 | */ |
||
| 27 | private $supportedBrowserList = [ |
||
| 28 | // name => version |
||
| 29 | 'Firefox' => 31, // https://www.mozilla.org/en-US/mobile/31.0/releasenotes/ |
||
| 30 | 'Chrome' => 37, // At least Chrome 37 supports CSP nonce-source |
||
| 31 | ]; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @param \Kenjis\Csp\Browser\AdapterInterface $browserDetector |
||
| 35 | */ |
||
| 36 | public function __construct(AdapterInterface $browserDetector) |
||
| 40 | |||
| 41 | /** |
||
| 42 | * Does browser support CSP nonce-source or not? |
||
| 43 | * |
||
| 44 | * @return boolean |
||
| 45 | */ |
||
| 46 | public function supportNonceSource() |
||
| 61 | } |
||
| 62 |