Skip to content

前端助手版本操作 Ver 2.2.3

getFrontendVersion

获取前端助手版本号。

typescript
function getFrontendVersion(): string {
  return $(".js-settings", window.parent.document)
    .find(".extension_info.flex-container.spaceBetween > small")
    .text()
    .replace("Ver ", "");
}

返回值

  • 前端助手版本号: string

提示

自然地, 旧版本前端助手并没有这个函数。为了让该功能在旧版本下正常使用,你可以直接使用该函数内部的实现:

typescript
const version = $(".js-settings", window.parent.document)
  .find(".extension_info.flex-container.spaceBetween > small")
  .text()
  .replace("Ver ", "");

updateFrontendVersion

尝试主动更新前端助手。

typescript
async function updateFrontendVersion(): Promise<boolean>;

返回值

  • 是否更新成功: boolean

作者:KAKAA, 青空莉想做舞台少女的狗