相关疑难解决方法(0)

Chrome扩展程序:在内容脚本中访问localStorage

所以,我有一个选项页面,用户可以在其中定义某些选项并将其保存在localStorage中: options.html

现在,我还有一个内容脚本需要获取options.html页面中定义的选项,但是当我尝试从内容脚本访问localStorage时,它不会从选项页面返回值.

如何让我的内容脚本从localStorage,选项页面甚至后台页面获取值?

local-storage google-chrome-extension content-script

148
推荐指数
4
解决办法
9万
查看次数

即使Chrome已关闭也会运行Chrome扩展程序

我有一个镀铬扩展,在打开镀铬时运行良好.问题是铬应用程序关闭时.我需要使扩展程序始终运行 - 打开或关闭Chrome浏览器.是否有任何方法可以使扩展即使在Chrome关闭时也能运行?

google-chrome-extension

7
推荐指数
1
解决办法
2061
查看次数

如何使用makepdf将Web worker应用于渲染PDF

我使用JavaScript插件(pdfmake)成功创建了一个PDF ,非常棒.但是当我尝试渲染~8,000行的库存/分类帐打印输出时,它会冻结超过一分钟.

这就是我通常声明我的docDefinition的方式

var docDefinition = { 
pageOrientation: orientation, 
footer: function(currentPage, pageCount) { return {text: currentPage.toString() + ' / ' + pageCount, fontSize:8, alignment:'center'}; }, 
content:[ 
   printHeader, 
  { fontSize: 8, alignment: 'right', style: 'tableExample', 
   table: { 
       widths: width, 
       headerRows: 1, body: arr }, 
   layout: 'lightHorizontalLines' }] }
Run Code Online (Sandbox Code Playgroud)

哪里

var printHeader =   [ { text: 'COMPANY NAME',alignment:'center' },
{ text: 'Address 1',alignment:'center' },
{ text: 'Address 2',alignment:'center' },
{ text: 'Additional Details,alignment:'center' },
{ text: 'document title',alignment:'center' }];
Run Code Online (Sandbox Code Playgroud)

和 …

javascript pdf web-worker pdfmake

3
推荐指数
1
解决办法
2082
查看次数