This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function () { | |
| //全体で使用する変数 | |
| /*ここに演習 4 タスク 1 で変数を追加します。*/ | |
| //全体で使用する変数 | |
| let canvas; | |
| let ctx; | |
| let img = { snow: null, snow_man: null }; | |
| let requestId; | |
| //DOM のロードが完了したら実行 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function () { | |
| //全体で使用する変数 | |
| /*ここに演習 4 タスク 1 で変数を追加します。*/ | |
| //全体で使用する変数 | |
| let canvas; | |
| let ctx; | |
| let img = { snow: null, snow_man: null }; | |
| let requestId; | |
| //DOM のロードが完了したら実行 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function () { | |
| //全体で使用する変数 | |
| /*ここに演習 4 タスク 1 で変数を追加します。*/ | |
| //全体で使用する変数 | |
| let canvas; | |
| let ctx; | |
| let img = { snow: null, snow_man: null }; | |
| let requestId; | |
| //DOM のロードが完了したら実行 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function(){ | |
| //全体で使用する変数 | |
| /*ここに演習 4 タスク 1 で変数を追加します。*/ | |
| //全体で使用する変数 | |
| let canvas; | |
| let ctx; | |
| let img = {snow:null,snow_man:null}; | |
| let requestId; | |
| //DOM のロードが完了したら実行 | |
| document.addEventListener('DOMContentLoaded', function () { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Edge の名前空間(browser) がなけれぱ chrome の名前空間を使用する | |
| var browser = browser || chrome; | |
| //リンクをクリックした回数をカウントする | |
| let clickCount = 0; | |
| let anchors = document.getElementsByTagName('li'); | |
| let len = anchors.length; | |
| for(let i=0;i<len;i++){ | |
| anchors[i].addEventListener('click',()=>{ | |
| clickCount++; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| alert('Welcome to the MSDN Blog.'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "Content scripts sample", | |
| "author": "(Your name write down here.)", | |
| "version": "0.1", | |
| "description": "特定の Web サイトむけの js を実行", | |
| "content_scripts": [{ | |
| "matches": ["*://blogs.msdn.microsoft.com/*"], | |
| "js" : ["forMSDN_Blog.js"] | |
| },{ | |
| "matches": ["*://www.microsoft.com/ja-jp/windows/microsoft-edge/*"], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let h1 = document.createElement('h1'); | |
| h1.textContent = "アドレスバーのアイコンがクリックされました"; | |
| h1.style.color = 'red'; | |
| document.body.appendChild(h1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Edge の名前空間(browser) がなけれぱ chrome の名前空間を使用する | |
| var browser = browser || chrome; | |
| //Page action | |
| browser.tabs.onUpdated.addListener(function (tabId, changInfo, tab){ | |
| //URL に 'edge' という文字列が含まれていたらアドレスバーにアイコンを表示 | |
| if(tab.url.indexOf('edge') != -1){ | |
| browser.pageAction.show(tabId); | |
| } | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "Page action sample", | |
| "author": "Osamu Monoe", | |
| "version": "0.1", | |
| "manifest_version": 2, | |
| "description": "アクティブなタブのコンテンツを操作", | |
| "page_action": { | |
| "default_icon": { | |
| "19": "icon/e-19.png" | |
| }, |