Skip to content

[Feature] GM_info 中應新增 isIncognito,sandboxMode,userAgentData #478

@cyfung1031

Description

@cyfung1031
    isIncognito: boolean,
    sandboxMode: SandboxMode,
    userAgentData: UADataValues,

https://www.tampermonkey.net/documentation.php?locale=en#api:GM_info

這3個都比較常用。因為在私隱模式中,或者不同的瀏覽器內,userscript的功能也許會不同
(例如使用cookie/localStorage與否)

userAgentData 是因為部份瀏覽器會改掉(或刪除) navigator.userAgentData 而防止廣告之類
所以要插件本身提供這個


PS. isIncognito 可用 chrome.extension.inIncognitoContext 判斷
sandboxMode 是指 可否直接js操作,或只能修改DOM之類。我想這個不難。ScriptCat裡運行腳本有分開,只是還沒有在GM_info中提示這個資料
userAgentData ,瀏覽器支持的話用插件中navigator.userAgentData就可以. 不支持的話不模擬也行

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions