Project

General

Profile

Download (527 Bytes) Statistics
| Branch: | Tag: | Revision:

haketilo / common / browser.js @ b93f26bf

1
/**
2
 * Myext WebExtension API access normalization
3
 *
4
 * Copyright (C) 2021 Wojtek Kosior
5
 * Redistribution terms are gathered in the `copyright' file.
6
 */
7

    
8
"use strict";
9

    
10
/*
11
 * This module normalizes access to WebExtension apis between
12
 * chrome-based and firefox-based browsers.
13
 */
14

    
15
(() => {
16
    if (typeof browser === "object") {
17
	window.browser = browser;
18
	window.is_chrome = false;
19
	window.is_mozilla = true;
20
    } else {
21
	window.browser = window.chrome;
22
	window.is_chrome = true;
23
	window.is_mozilla = false;
24
    }
25
})();
(1-1/9)