DescriptionImplement declarative content script API for <webview> [js part].
Sample code:
var webview = document.querySelector('webview');
var rule = {
conditions: [
new chrome.declarativeContent.PageStateMatcher(
{ pageUrl: { hostContains: '' } })],
actions: [
new chrome.declarativeContent.RequestContentScript(
{js: ['script.js']}) ]
};
webview.request.onPageChanged.addRules([rule]);
BUG=437566
Committed: https://crrev.com/6ca136250497327f235096a60babd6394e825d32
Cr-Commit-Position: refs/heads/master@{#309030}
Patch Set 1 #Patch Set 2 : Handle the "declarativeContent" event naming. #Patch Set 3 : #Patch Set 4 : Rebase. #Patch Set 5 : Move to experimantal. #
Total comments: 2
Patch Set 6 : Introduce DeclarativeContentEvent. #
Total comments: 4
Patch Set 7 : Updated based on another refactor "Issue 794803002: Refactor: cleanup declarative_api.cc.". #Patch Set 8 : Updated. #
Messages
Total messages: 19 (7 generated)
|