Fix async condition not work in Violentmonkey with Firefox

This commit is contained in:
the1812 2019-04-26 22:48:45 +08:00
parent 003cd10d8a
commit ee052033e5
7 changed files with 13 additions and 10 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1982,7 +1982,7 @@ class ResourceManager
if (typeof info.condition === "function")
{
condition = info.condition();
if (condition instanceof Promise)
if (typeof condition === "object" && "then" in condition)
{
condition = await condition.catch(() => { return false; });
}

View File

@ -1982,7 +1982,7 @@ class ResourceManager
if (typeof info.condition === "function")
{
condition = info.condition();
if (condition instanceof Promise)
if (typeof condition === "object" && "then" in condition)
{
condition = await condition.catch(() => { return false; });
}

View File

@ -206,7 +206,7 @@ export class ResourceManager
if (typeof info.condition === "function")
{
condition = info.condition();
if (condition instanceof Promise)
if (typeof condition === "object" && "then" in condition)
{
condition = await condition.catch(() => { return false; });
}

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 45 KiB

View File

@ -321,4 +321,7 @@
</div>
</li>
</ul>
</div>
<div class="custom-navbar-settings">
</div>

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 48 KiB