M
M
Matvey Kot2020-02-07 17:17:45
Google Chrome
Matvey Kot, 2020-02-07 17:17:45

How to make a Chrome plugin run in the background?

There is a plugin for Chromium like browsers. The plugin is a regular player (using the audio tag).
I work in Opera ("Gaming" browser)

Plugin interface screenshot:
5e3d70fd391ed306693088.png
Web file code:

<html>
<head>
  <link rel="stylesheet" type="text/css" href="style.css">
  <meta charset="utf-8">
  <link href="https://fonts.googleapis.com/css?family=Roboto&display=swap" rel="stylesheet">
  <style type="text/css">
    h2 {
      text-align: center;
      font-family: 'Roboto', sans-serif;
    }

    .audio {
      width: 500px;
    }
  </style>
</head>
<body>
<h2>Unicorn Heads A Mystical Experience [ID: 1]</h2>
<h2><audio controls class="audio">
  <source src="audio/1.mp3" type="audio/mpeg">
    Тег audio не поддерживается вашим браузером.
</audio></h2>
</body>
</html>


Manifest file code:
{
  "manifest_version": 2,
  "name": "Music Phone",
  "description": "Запускает музыку",
  "version": "1.0.0",
  "icons": {"128": "icon_128.png"},
  "browser_action": {
    "default_icon": "icon.png",
    "default_popup": "popup.html"
  },
  "permissions": ["activeTab"]
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question