当我尝试在firefox中创建Bookmark时,在控制台中出现ReferenceError:“浏览器未定义”

时间:2019-06-18 08:35:46

标签: javascript html firefox-webextensions

我正在尝试创建一个书签(在本例中为Firefox)

API /书签/创建

我的代码是:

<!doctype html>
<HTML lang="de">
 <HEAD>
  
  <meta charset="iso-8859-1">
  <link   href = 'https://office.spdns.de/System/TDL/Images/Browser/Company.ico' rel = 'SHORTCUT ICON'>

  <link rel="manifest" href="bookmark/manifest.json">

  <link   href = 'https://office.spdns.de/TDL/Common/CSS/Default.css'            rel = 'stylesheet' type = 'text/css'>
  <link   href = 'https://office.spdns.de/TDL/Common/CSS/Formular_OnLine.css'    rel = 'stylesheet' type = 'text/css'>
 </HEAD>
 <BODY lang=DE vLink=blue link=blue bgColor=white>
  <form action='https://office.spdns.de/TDL/Tools/WebExtensions.php' name='WebExtensions' id='WebExtensions' method='post' >
      <BR>

<script>

function onCreated(node) {
  console.log(node);
}

var createBookmark = browser.bookmarks.create({
  title: "Set time of work",
  url: "https://office.spdns.de/TDL/Tools/WebExtensions.php"
});

createBookmark.then(onCreated);

</script>
  </form>
 </BODY>
</HTML>

manifest.json: {   “ manifest_version”:2   “ name”:“ BookmarkOnce”,   “ version”:“ 1.1”,   “ description”:“在您的工作中将这个页面添加为书签”,   “权限”:[     “书签”   ] }

0 个答案:

没有答案