如何为标题创建匹配模式 [英] How to create a match pattern for a title

查看:92
本文介绍了如何为标题创建匹配模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用 chrome.tabs.query 作为标题。
但是,如果我查看文档,似乎仅匹配模式使用网址?我试过的每种模式都不起作用

I am trying to use the chrome.tabs.query for a title. However, if I look at the documentation, it appears that match patterns only work with URLs? Every type of pattern that I try does not work

以下是代码:

Here is the code:

chrome.tabs.query({'title':searchText}, function(tabArray){
    tabbr.update(tabArray);
});


推荐答案

匹配模式应该是通配符字符串:


The match patterns should be wildcarded strings:

chrome.tabs.query({'title': '*string*'}, function(tabArray){
  tabbr.update(tabArray);
});

这篇关于如何为标题创建匹配模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆