上一主题 下一主题
ScriptCat,新一代的脚本管理器脚本站,与全世界分享你的用户脚本油猴脚本开发指南教程目录
返回列表 发新帖

油猴脚本能实现跨网站数据共享吗

[复制链接]
  • TA的每日心情
    奋斗
    2022-10-28 17:23
  • 签到天数: 3 天

    [LV.2]偶尔看看I

    2

    主题

    7

    回帖

    11

    积分

    助理工程师

    积分
    11
    发表于 2022-10-28 17:21:21 | 显示全部楼层 | 阅读模式
    悬赏15油猫币未解决

    就是在A网站有一个油猴脚本,它能够提取网页中的一些数据。从A跳转到B网站后,能不能自动把这些数据填写到网站B的输入框里。
    网站A和B是跨域的,两者没有什么关联。仅仅是想把从网站A获取到的数据填入到网站B里。

  • TA的每日心情
    开心
    2023-2-28 23:59
  • 签到天数: 191 天

    [LV.7]常住居民III

    636

    主题

    5185

    回帖

    6068

    积分

    管理员

    非物质文化遗产社会摇传承人

    积分
    6068

    荣誉开发者管理员油中2周年生态建设者喜迎中秋

    发表于 2022-10-28 17:54:41 | 显示全部楼层
    gm_setvalue getvalue GM_addValueChangeListener可以跨页面通信
    GM_setValue(name, value)
    Set the value of 'name' to the storage.

    GM_getValue(name, defaultValue)
    Get the value of 'name' from storage.

    GM_addValueChangeListener(name, function(name, old_value, new_value, remote) {})
    Adds a change listener to the storage and returns the listener ID.
    'name' is the name of the observed variable.
    The 'remote' argument of the callback function shows whether this value was modified from the instance of another tab (true) or within this script instance (false).
    Therefore this functionality can be used by scripts of different browser tabs to communicate with each other.
    混的人。
    ------------------------------------------
    進撃!永遠の帝国の破壊虎---李恒道

    入驻了爱发电https://afdian.net/a/lihengdao666
    个人宣言:この世界で私に胜てる人とコードはまだ生まれていません。死ぬのが怖くなければ来てください。
    回复

    使用道具 举报

    发表回复

    本版积分规则

    快速回复 返回顶部 返回列表