タグ

ブックマーク / trycatchand.blogspot.com (1)

  • Chrome拡張機能でDOMを操作する方法

    今回はChrome拡張機能からDOMを操作する方法をご紹介します。 これから紹介するサンプルは、(1)ブラウザアクションボタンが押されると (2)ページタイトルを'hoge'に変更し、(3)ボタンを押した側(つまりbackground.js)にタイトルが変更されたことを通知する、という動きをする拡張機能です。 manifest.json { "name": "DOM manipulation Example", "version": "1.0", "description": "Chrome Extension Example for manipulating DOM.", "content_scripts": [{ "matches": ["<all_urls>"], "js": ["content.js"] }], "background": { "scripts": ["backgr

    hiragram
    hiragram 2017/01/02
  • 1