Revision 9d825eaa
Added by koszko over 1 year ago
| common/misc.js | ||
|---|---|---|
| 96 | 96 |
* Check if url corresponds to a browser's special page (or a directory index in |
| 97 | 97 |
* case of `file://' protocol). |
| 98 | 98 |
*/ |
| 99 |
const privileged_reg = |
|
| 100 |
/^(chrome(-extension)?|moz-extension):\/\/|^about:|^file:\/\/.*\/$/; |
|
| 101 |
#EXPORT url => privileged_reg.test(url) AS is_privileged_url |
|
| 99 |
#IF MOZILLA |
|
| 100 |
const priv_reg = /^moz-extension:\/\/|^about:|^file:\/\/[^?#]*\/([?#]|$)/; |
|
| 101 |
#ELIF CHROMIUM |
|
| 102 |
const priv_reg = /^chrome(-extension)?:\/\/|^about:|^file:\/\/[^?#]*\/([?#]|$)/; |
|
| 103 |
#ENDIF |
|
| 104 |
#EXPORT url => priv_reg.test(url) AS is_privileged_url |
|
| 102 | 105 |
|
| 103 | 106 |
/* Parse a CSP header */ |
| 104 | 107 |
function parse_csp(csp) {
|
Also available in: Unified diff
add new root content script