谷歌浏览器扩展程序 - 等待页面加载 [英] Google Chrome Extension - waiting until page loads
问题描述
在我的Google Chrome扩展程序中,我有一个内容脚本(内容。 js)和背景页(background.html)。我有context.js检查页面上显示的关键字。但是,我希望等到页面完全加载后才能搜索页面,因为关键字可能出现在页面的底部。
In my Google Chrome Extension, I have a Content Script (content.js) and a Background Page (background.html). I have context.js checking for a keyword that appears on the page. However, I want to wait until the page is fully loaded until I search the page, because the keyword may occur at the bottom of the page.
请参阅按内容 sandwich示例(文件),这基本上是我在做什么。如果你加载扩展名,你会看到扩展名仅在页面顶部出现单词sandwich时才起作用。
See Page action by content sandwich example (files), this is basically what I am doing. If you load the extension you'll see the extension only works when the word "sandwich" appears at the top of the page.
推荐答案
<
"run_at": "document_end"
http://code.google.com/chrome/extensions/content_scripts.html
这篇关于谷歌浏览器扩展程序 - 等待页面加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!