[英]Chrome isn't showing new updated html, javascript? Maybe overlooking?
我有一個應該擴展的服務按鈕。 地址對象選項卡展開,我從前面提到的地址對象html復制了html。 我正在使用記事本++,這種情況經常發生,這讓我覺得這是我忽略但卻無法找到它的東西。 奇怪的是,如果我使用我復制的地址按鈕,它有效嗎?!?
expand300.js
function expand300(){
var x = document.getElementById('tabFrame');
var y = x.contentDocument ;
var els = y.getElementsByClassName ('clickable collapsed');
for(i=-200;i<els.length;i++)
{
els[0].click()
}
}
expand300()
popup.html
function address300() {
chrome.tabs.query({active: true, currentWindow: true}, function(tabs)
{
// query the active tab, which will be only one tab
//and inject the script in it
chrome.tabs.executeScript(tabs[0].id, {file: "300/address.js"});
});
}
function expand300() {
chrome.tabs.query({active: true, currentWindow: true}, function(tabs)
{
// query the active tab, which will be only one tab
//and inject the script in it
chrome.tabs.executeScript(tabs[0].id, {file: "300/expand.js"});
});
}
function d_address300() {
chrome.tabs.query({active: true, currentWindow: true}, function(tabs)
{
// query the active tab, which will be only one tab
//and inject the script in it
chrome.tabs.executeScript(tabs[0].id, {file: "300/d_address.js"});
});
}
function service300() {
chrome.tabs.query({active: true, currentWindow: true}, function(tabs)
{
// query the active tab, which will be only one tab
//and inject the script in it
chrome.tabs.executeScript(tabs[0].id, {file: "300/service.js"});
});
}
function expand300() {
chrome.tabs.query({active: true, currentWindow: true}, function(tabs)
{
// query the active tab, which will be only one tab
//and inject the script in it
chrome.tabs.executeScript(tabs[0].id, {file: "300/expand.js"});
});
}
function d_service300() {
chrome.tabs.query({active: true, currentWindow: true}, function(tabs)
{
// query the active tab, which will be only one tab
//and inject the script in it
chrome.tabs.executeScript(tabs[0].id, {file: "300/d_service.js"});
});
}
popup.html
<!-- Objects Tab -->
<button class="collapsible" id="object300">Objects</button>
<div class="content">
<button class="collapsible" id="address300">Address Objects</button>
<div class="content">
<table>
<tr>
<td style='white-space: nowrap'>
<button id="obj_fld">Obj Tab</button><button id="grp_fld">Grp
Tab</button>
</td>
<td style='white-space: nowrap'>
<button id="expand300">Expand</button><button
id="d_address300">Download</button>
</td>
</tr>
</table>
</div>
<button class="collapsible" id="service300">Service Objects</button>
<div class="content">
<table>
<tr>
<td style='white-space: nowrap'>
<button id="obj_fld">Obj Tab</button><button id="grp_fld">Grp
Tab</button>
</td>
<td style='white-space: nowrap'>
<button id="expand300">Expand</button><button
id="d_service300">Download</button>
</td>
</tr>
</table>
</div>
</div>
我討厭回答我自己的問題,但是一旦我創建了一個額外的expand1函數,文件和監聽事件,它就可以了。 我引用了相同的ID ...
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.