aboutsummaryrefslogtreecommitdiff
path: root/common/is_background.mjs
blob: ef728a726b4cf9321304ad7bee671b841a9f9f56 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/**
* Myext programmatic check of where the script is being run
*
* Copyright (C) 2021 Wojtek Kosior
*
* Dual-licensed under:
*   - 0BSD license
*   - GPLv3 or (at your option) any later version
*/

/* This needs to be changed if we ever modify the html file path. */

export default function is_background()
{
    return window.location.protocol === "moz-extension:" &&
	window.location.pathname === "/background/background.html";
}