Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我已经看到了许多获取已存储数据的示例,但没有获取任何获取存储值的示例。
您可以通过 browser.executeScript() 以这种方式访问 localStorage:
获取价值
var value = browser.executeScript("return window.localStorage.getItem('myKey');");
设定值
browser.executeScript("window.localStorage.setItem('myKey', 'myValue');");