What are the differences between page actions and browser actions?

I did a browser action, but I just tried checking the action of the page. The button is placed in the same place, but the page action button cannot be pressed (the icon is grayed out). I thought the page button buttons were located in the address bar, not the toolbar. Why is it in one place?

My browser action button:
browser_action

My page action button:
page_action

+34
source share
1 answer

" " " " " ", Extension API. . , , .

, . , , / , , .

, / . , URL-.

, , , / , . /URL-. browserAction.disable() , ( ). /, URL-.

Chrome :

Google Chrome, . , , .

  • , .
  • , . .
  • , , 16x16 . , .
  • Google Chrome. , .
  • - , . , .
  • . .

API:

    • - browserAction.disable(integer tabId)
    • enable - browserAction.enable(integer tabId)
    • getBadgeBackgroundColor - browserAction.getBadgeBackgroundColor(object details, function callback)
    • getBadgeText - browserAction.getBadgeText(object details, function callback)
    • getPopup 1 - browserAction.getPopup(object details, function callback)
    • getTitle 1 - browserAction.getTitle(object details, function callback)
    • setBadgeBackgroundColor - browserAction.setBadgeBackgroundColor(object details)
    • setBadgeText - browserAction.setBadgeText(object details)
    • setIcon 1 - browserAction.setIcon(object details, function callback)
    • setPopup 1 - browserAction.setPopup(object details)
    • setTitle 1 - browserAction.setTitle(object details)

, URL-, , (.. URL-). / ("") URL-. pageAction.show() URL/, . /, URL-.

Chrome page ( ):

API chrome.pageAction Google Chrome, . , , . , .

, , ; , . , . , , .

, pageAction.show pageAction.hide . . , , . , URL- (, ).

  • , .
  • , . .
  • . .

API:

    • getPopup 1 - pageAction.getPopup(object details, function callback)
    • getTitle 1 - pageAction.getTitle(object details, function callback)
    • - chrome.pageAction.hide(integer tabId)
    • setIcon 1 - pageAction.setIcon(object details, function callback)
    • setPopup 1 - pageAction.setPopup(object details)
    • setTitle 1 - pageAction.setTitle(object details)
    • show - pageAction.show(integer tabId)

1. API , . .

+49

All Articles