We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c6f53bc commit 0b3c556Copy full SHA for 0b3c556
2 files changed
package.json
@@ -1,6 +1,6 @@
1
{
2
"name": "edkit",
3
- "version": "1.2.4",
+ "version": "1.2.5",
4
"license": "LGPL-3.0",
5
"author": "shiy2008@gmail.com",
6
"contributors": [
source/Tool.ts
@@ -20,6 +20,7 @@ export abstract class Tool {
20
21
return (
22
!command ||
23
+ !globalThis.document ||
24
document.queryCommandSupported(command) ||
25
document.queryCommandEnabled(command)
26
);
@@ -36,7 +37,8 @@ export abstract class Tool {
36
37
box.matches(tags.map(tag => `${tag}, ${tag} *`).join(', '))
38
39
}
- if (command) return document.queryCommandState(command);
40
+ if (command)
41
+ return !!globalThis.document && document.queryCommandState(command);
42
43
return false;
44
0 commit comments