我在使用Chrome API时遇到了问题,我使用的api调用是chrome.storage.sync.get,我用它来尝试获取内存中的一个变量,当返回变量时,它会返回Chrome控制台中的object Object (这应该不会发生),它应该返回一个数字,具体取决于在这里找到的内容,这是我的代码
//Get index variable
chrome.storage.sync.get("index_value", function (data1)
{
Get_value(data1)
});
function Get_value(value)
{
index = value;
console.log("Fetched index value is" + value);
}更多信息:
内存中的变量只是一个十进制数,例如1
我使用chrome.storage.sync.set应用程序接口调用来保存变量
变量名为index
变量index跟踪数组的位置,例如arrayindex
https://stackoverflow.com/questions/47669780
复制相似问题