douzhu1188 2015-06-05 04:05
浏览 277
已采纳

从Contentscript.js插入代码(Chrome扩展程序)

I am Developing the Politics & Information Google Chrome Extension but I have run into a problem, I am attempting to insert a JS Script into one of the div's of the Webpage, the result is nothing, absolutely nothing pops up

I know i have the right area because if I use += "Hello"; it displays the text there properly, but when I actually do +="" the script doesn't seem to run. To all them devs out there, any suggestions?

How I am doing it:

theinfotable.children[0].innerHTML += ''; JavaScript (Google Chrome Extension inserted from the Contentscripts.js file)

I can see that the Code Inserted, but the script still doesn't seem to load: (And I know this code works when I have my own page instead of inserting) http://oi61.tinypic.com/2irkx9c.jpg

  • 写回答

2条回答 默认 最新

  • douaoren4402 2015-06-10 14:58
    关注

    I figured out the problem, the page was blocking my script as "Insecure" at the top right there was a little Shield Icon and after clicking on it I just had to put "Show Insecure Scripts" and it popped up.

    (If anyone feels like telling me so people don't have to do this, that'd be great :D) I would rather people just have it pop up instead of having to stay for it to pop up

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!