【问题标题】:Get data marked by user Extension [duplicate]获取用户扩展标记的数据[重复]
【发布时间】:2022-11-21 01:42:59
【问题描述】:

我想获取用户选择的值。我唯一的例子是 Google Translation Extension 所做的:

我找不到关于此的另一篇文章,所以我在这里问,我该怎么做。

【问题讨论】:

    标签: google-chrome-extension


    【解决方案1】:

    经过搜索和大量测试,解决方案是使用:

    window.getSelection().getRangeAt(0).toString()
    

    【讨论】:

      猜你喜欢
      • 2023-03-08
      • 2012-03-24
      • 2011-08-27
      • 1970-01-01
      • 2010-10-14
      • 2011-06-05
      • 2020-05-20
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多