English 中文(简体)
条件背景 取决于地点
原标题:Conditional contextMenus depending on site

I m正在做一些小小小小小小的延伸,在用户正确点击一个网页时,使用“情况表”添加一个选项或两个。 然而,这只与几个网页有关,我只想在相关时显示额外的菜单项目。

因此,我要把目前的URL带入我的背景网页,看看URL是否与我的白人名单上的任何地点相匹配。

我ve一环,但我确信这甚至是不可能的。 任何帮助都会受到赞赏,而且我不会幸免细节—— Java本不是我的有力方面。

最佳回答

http://code.google.com/chrome/extensions/contextMenus.html” rel=“nofollow”

chrome.contextMenus.create(object createProperties, function callback)

<>12>

createProperties ( object )

type ( optional enumerated string ["normal", "checkbox", "radio", "separator"] )

2. 菜单项目类型。 如果未具体指明,违约即告正常。

title ( optional string )

在该项目下将展示的案文;除非类型是分离器,否则需要这样做。 在选择背景时,你可以使用体内的百分比来显示选定的案文。 例如,如果这一参数的数值是“向Pig Latin”转换成百分数,而用户选择“冷却”一词,则选择的环境菜单是“向Pig Latin”的。

checked ( optional boolean )

检查箱或广播节目的初始状态:选用和假选。 某一组广播节目仅能选择一个广播节目。

contexts ( optional array of string ["all", "page", "frame", "selection", "link", "editable", "image", "video", "audio"] )

这一菜单项目将出现在背景清单中。 如果未具体指明,可到[页]。

parentId ( optional integer )

母子菜单的识别项目;这使该项目成为先前添加的项目的儿童。

documentUrlPatterns ( optional array of string )

www.un.org/Depts/DGACM/index_spanish.htm 请允许我将这个项目限制在只适用于与特定模式之一相对应的文件上。 (也适用于框架)。 模式格式详情,见Match patternss.。

targetUrlPatterns ( optional array of string )

类似文件 UrlPatterns, 但允许你根据成像/视像/分流的分流和 anchor子的分流进行过滤。

onclick ( optional function )

当菜单项目被点击时,该功能将被叫回。

<>12>

info ( OnClickData )

点击该项目的情况和点击情况。

tab ( Tab )

点击地点的详细表格。

问题回答

暂无回答




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签