Answer the question
In order to leave comments, you need to log in
How to implement plugin for Chrome with preview?
Hello everyone, there are articles on the Internet on creating a plugin for Chrome, but I did not find an implementation: by the button on the bookmarks bar, when hovering, a page preview is displayed, if you click on the button, then go to the page.
1.HTML file:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Tproger Media Quick Launcher</title>
<!--ссылаемся на шрифты, используемые в документе-->
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet" type="text/css">
<!--здесь мы ссылаемся на стили, которые будем использовать в документе, а именно стиль иконок-->
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN"
crossorigin="anonymous">
</head>
<body>
</body>
</html>
2-й файл JS:
<code lang="javascript">
chrome.browserAction.onClicked.addListener(function() {
chrome.tabs.create({'url': "http://site.example.com"});
});
3-й файл JSON:
<code lang="html">
{
"name": "Stackoverflow",
"version": "1",
"browser_action":
{
"default_icon": "icon.png"
},
"background":
{
"page": "popup.html"
},
"permissions": ["tabs"],
"manifest_version": 2
}
</code>
</code>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question