28 lines
938 B
JavaScript
28 lines
938 B
JavaScript
/*
|
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
* or more contributor license agreements. Licensed under the Elastic License;
|
|
* you may not use this file except in compliance with the Elastic License.
|
|
*/
|
|
|
|
/* eslint-disable no-undef */
|
|
chrome.runtime.onInstalled.addListener(function() {
|
|
chrome.storage.sync.set({ outputType: 'typescript' });
|
|
|
|
chrome.declarativeContent.onPageChanged.removeRules(undefined, () => {
|
|
// Only activate the plugin on localhost
|
|
chrome.declarativeContent.onPageChanged.addRules([
|
|
{
|
|
conditions: [
|
|
new chrome.declarativeContent.PageStateMatcher({
|
|
pageUrl: { hostEquals: 'localhost' },
|
|
}),
|
|
new chrome.declarativeContent.PageStateMatcher({
|
|
pageUrl: { hostEquals: 'kibana-dev' },
|
|
}),
|
|
],
|
|
actions: [new chrome.declarativeContent.ShowPageAction()],
|
|
},
|
|
]);
|
|
});
|
|
});
|