diff options
| author | Teddy Wing | 2014-12-13 12:46:47 -0500 | 
|---|---|---|
| committer | Teddy Wing | 2014-12-13 12:46:47 -0500 | 
| commit | 13c1c99efdbd748ecfec81bdd07b556022316e79 (patch) | |
| tree | 0c85755831950a224716fcdea07d2c59d7aa80f8 | |
| download | chrome-youtube-tooltipise-titles-13c1c99efdbd748ecfec81bdd07b556022316e79.tar.bz2 | |
Initial commit. Working.
Add manifest.json, add functionality in content script that copies the
YouTube video title into the title link's `title=` HTML attribute to
give us the tooltip.
| -rw-r--r-- | manifest.json | 18 | ||||
| -rw-r--r-- | tooltipise.js | 7 | 
2 files changed, 25 insertions, 0 deletions
| diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..792bdb2 --- /dev/null +++ b/manifest.json @@ -0,0 +1,18 @@ +{ +	"manifest_version": 2, + +	"name": "YouTube Tooltipise Titles", +	"description": "Add title tooltips to video titles on YouTube so you can read them even after ellipsis truncation", +	"version": "0.0.1", +	 +	"content_scripts": [ +		{ +			"matches": ["*://*.youtube.com/*"], +			"js": ["tooltipise.js"] +		} +	], +	 +	"permissions": [ +		"*://*.youtube.com/*" +	] +} diff --git a/tooltipise.js b/tooltipise.js new file mode 100644 index 0000000..8d90aba --- /dev/null +++ b/tooltipise.js @@ -0,0 +1,7 @@ +(function() { +	var title_elements = document.querySelectorAll('.yt-uix-sessionlink.yt-uix-tile-link'); +	 +	for (var i = 0; i < title_elements.length; i++) { +		title_elements[i].setAttribute('title', title_elements[i].innerText); +	} +})() | 
