我创建了一个我希望在域的特定路径上显示的页面操作。在某些时候,如果此路径包含字符串document.addEventListener('DOMContentLoaded', function() {
chrome.tabs.query({
'active' : true,
'lastFocusedWindow' : true
}, function(tabs) {
var url = tabs[0].url;
if (url.indexOf('/search/') !== -1){
chrome.pageAction.hide(tabs[0].id)
}
});
...
,我希望隐藏操作。这是应该实现的代码:
tabs[0].id
执行条件并且 final SoapObject request = new SoapObject(UrlActivity.NAMESPACE, UrlActivity.METHOD_NAME);
// TODO the two params are child soap objects not properties
SoapObject loyal = new SoapObject(UrlActivity.NAMESPACE, "LoyalCustCode");
loyal.setInnerText("1234");
request.addSoapObject(loyal);
loyal = new SoapObject(UrlActivity.NAMESPACE, "PwdStr");
loyal.setInnerText("1234");
request.addSoapObject(loyal);
//Params are different than child node
具有选项卡的ID,但页面操作未被隐藏(我的按钮不会变灰并且点击它时会显示弹出窗口不应该显示的内容。< / p>
我对Chrome中的pageActions有什么误解吗?我怎样才能有条理地隐藏行动?