summaryrefslogtreecommitdiff
path: root/src/lib/UA.js
blob: d87efbb41739d01ac011147ae04c7cfabeff35a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{
  let mozWebExtUrl = document.URL.startsWith("moz-");
  let isMozilla = mozWebExtUrl || window.wrappedJSObject === "object";
  if (isMozilla) {
    if (mozWebExtUrl) {
      // help browser-specific UI styling
      document.documentElement.classList.add("mozwebext");
    }
  } else {
    // shims for non-Mozilla browsers
    if (typeof chrome === "object" && !chrome.tabs) {
      // content script shims
      if (typeof exportFunction === "undefined") {
        window.exportFunction = () => {};
      }
    }
  }

  var UA = {
    isMozilla
  };
}