popup.js 810 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // 右键
  2. // var menuItem = {
  3. // "id":"ida",
  4. // "title":"不要点击",
  5. // }
  6. // chrome.contextMenus.create(menuItem)
  7. // document.getElementById('btn').onclick = function () {
  8. // }
  9. // window.onload = function(){
  10. // chrome.tabs.executeScript({
  11. // file: 'js/content.js'
  12. // })
  13. // }
  14. // 1.访问一个网络文件
  15. // version
  16. // 访问
  17. // 访问网络文件
  18. function init(res) {
  19. document.body.style.width = res.width
  20. document.body.style.height = res.height
  21. }
  22. window.onload = ()=>{
  23. chrome.storage.sync.get({ config: '' }, (item) => {
  24. let config = JSON.parse(item.config)
  25. init(config.popup)
  26. })
  27. updateConfig()
  28. }
  29. // popup.width
  30. // 网络请求
  31. // 1.查看线上版本号
  32. // 2.和本地比对,不一样,本地config 全部替换
  33. // 3.操作更改