chrome extensions & debug

debug background.js

debug popup.js

debug content_script.js

chrome.storage

chrome.storage.sync.get bug


// array OK
chrome.storage.sync.get([
"jira_str",
"jira_obj"
], function(items) {
console.log(`chrome.storage.sync.get OK!`);
console.log(`get items =`, JSON.stringify(items, null, 4));
}); // object Error
chrome.storage.sync.get({
jira_str,
jira_obj,
}, function(items) {
console.log(`chrome.storage.sync.get OK!`);
console.log(`get items =`, JSON.stringify(items, null, 4));
}); // chrome.storage.sync.get({
// "jira_str",
// "jira_obj",
// }, function(items) {
// console.log(`chrome.storage.sync.get OK!`);
// console.log(`get items =`, JSON.stringify(items, null, 4));
// });

API

https://developer.chrome.com/extensions/storage

https://developer.chrome.com/extensions/storage#using-sync

To store user data for your extension, you can use either storage.sync, or storage.local


// storage.sync
chrome.storage.sync.set({key: value}, function() {
console.log('Value is set to ' + value);
}); chrome.storage.sync.get(['key'], function(result) {
console.log('Value currently is ' + result.key);
});
// storage.local:

chrome.storage.local.set({key: value}, function() {
console.log('Value is set to ' + value);
}); chrome.storage.local.get(['key'], function(result) {
console.log('Value currently is ' + result.key);
});

https://stackoverflow.com/questions/14531102/saving-and-retrieving-from-chrome-storage-sync

https://stackoverflow.com/questions/22636771/chrome-storage-sync-vs-chrome-storage-local

https://bugs.chromium.org/p/chromium/issues/detail?id=161771

localStorage API

https://developer.mozilla.org/en/DOM/Storage#localStorage


zip

bash shell zip

# admin pwd
$ sudo apt install zip $ zip -r chrome-jira.2018.12.18.zip chrome-jira/*

https://www.cnblogs.com/xgqfrms/p/9714161.html


official api docs

https://developer.chrome.com/extensions

https://developer.chrome.com/extensions/windows

https://developer.chrome.com/extensions/extension

https://developer.chrome.com/extensions/commands

https://developer.chrome.com/extensions/browserAction

https://developer.chrome.com/extensions/pageAction

https://developer.chrome.com/extensions/runtime

https://developer.chrome.com/extensions/runtime#property-lastError

https://developer.chrome.com/extensions/tabs

https://developer.chrome.com/extensions/system_storage

https://developer.chrome.com/extensions/system_memory

https://developer.chrome.com/extensions/system_cpu

https://developer.chrome.com/extensions/platformKeys

https://developer.chrome.com/extensions/omnibox

chrome extensions & debug的更多相关文章

  1. Jira & SVN & Chrome extensions

    Jira & SVN & Chrome extensions Plugins SVN & Jira Plugins ok selector bug document.query ...

  2. 如何在Chrome下Debug Mocha的测试

    简介 经过前两篇文章的介绍,相信读者对Mocha应该有一定的认知了,本文重点讲述如何在Chrome下Debug Mocha Test, 方便你在测试fail的时候troubleshooting. 关键 ...

  3. Best Chrome Extensions

    Best Chrome Extensions chrome://extensions/ # ghelper chrome-extension://cieikaeocafmceoapfogpffaalk ...

  4. Chrome Extensions API & options

    Chrome Extensions API options https://developer.chrome.com/extensions https://developer.chrome.com/e ...

  5. Do Chrome extensions access iframes? chrome扩展插件访问所有iframes

    32down voteaccepted Yes, a Chrome Extension "content script" can run in all iframes (that ...

  6. chrome浏览器debug

    Chrome浏览器审查元素 1.Elements标签页 Elements标签页的左侧就是对页面HTML结构的查看与编辑,你可以直接在某个元素上双击修改元素的属性. 1.Edit as HTML直接对元 ...

  7. chrome extensions notifications

    developer.chrome.comhttps://developer.chrome.com/extensions/notifications notification | MDNhttps:// ...

  8. chrome dev debug network 的timeline说明

    在使用chrome的时候F12的开发者工具中有个network,其中对每个请求有个timeline的说明,当鼠标放上去会有下面的显示: 这里面的几个指标在说明在chrome使用文档有说明: 下面我用人 ...

  9. chrome extensions

        chrome web store   AppsGamesExtensionsThemes   CATEGORIES   All FEATURESClear   Runs Offline By ...

随机推荐

  1. Codeforces Round #482 (Div. 2) : Kuro and GCD and XOR and SUM (寻找最大异或值)

    题目链接:http://codeforces.com/contest/979/problem/D 参考大神博客:https://www.cnblogs.com/kickit/p/9046953.htm ...

  2. 笔记-sql语句

    笔记-sql语句 1.      sql语句基础 虽然经常使用sql语句,但没有一个整体式的文档,整理了一下. 1.1.    select foundation: select <colnum ...

  3. DSP5509的XF实验-第一篇

    1. 使用大道科技的EASY-DSP5509开发板,测试第一个例程,DSP_easy5509\Code-Easy5509\EX01_XF\XF 2. 直接编译,报出错误,在Problems窗口错误指示 ...

  4. centos7 的防火墙命令调整了

    CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙.firewall:systemctl start firewalld.service#启动firewalls ...

  5. 虚拟机安装win7 64位-完美解决-费元星

    安装虚拟机是为了安装一个oracle ,在本机安装 ,本机会卡死,不是每次启动电脑都用oralce,而且有时候服务是关不干净的,所以安装在虚拟机里,需要的时候在开启,特做此记录! 费元星版权Q[971 ...

  6. python简单的socket 服务器和客户端

    服务器端代码 if "__main__" == __name__: try: sock = socket.socket(socket.AF_INET, socket.SOCK_ST ...

  7. 问题:Visual Studio 2017 无法推送到github:The requested URL returned error: 403

    问题: Visual Studio 2017 无法推送到github:The requested URL returned error: 403 原因分析: Visual Studio 2017记录的 ...

  8. AirtestIDE实践二:Poco框架试用

    上一篇用airtest框架做了一个梦幻西游手游的DEMO,这次看看poco的强大之处.首先安装poco:pip install pocoui 其次,把SDK集成到你家游戏中,我这直接用官网提供的一个U ...

  9. Selenium(Python) ddt读取Excel文件数据驱动

    首先, 引入xlrd模块: ExcelDDT.py: import unittestfrom time import sleep from ddt import ddt, datafrom selen ...

  10. Linux命令应用大词典-第5章 显示文本和文件内容

    5.1 cat:显示文本文件 5.2 more:分页显示文本文件 5.3 less:回卷显示文本文件 5.4 head:显示指定文件前若干行 5.5 tail:查看文件末尾数据 5.6 nl:显示文件 ...