I am trying to create a Chrome extension that creates a button like a normal one that displays a custom page I made (this has already been done and works on my extension) but the next thing I wish to do, and I am not sure how to implement, is to inject markup into a specific webpage...
Here is my manifest.json:
{
"manifest_version": 2,
"name": "BattleNetwork",
"description": "Your onestop BattleNetwork info center!",
"version": "1.0",
"browser_action": {
"default_icon": "icon.png",
"default_popup": "popup.html"
},
"permissions": [
"http://robloxdatabase.x10.bz/"
]
}
Pretty standard. I know about the "Content Scripts" (https://developer.chrome.com/extensions/content_scripts) however, I am not sure if those will work for what I want, I wish to inject the following HTML:
<div class="games-list-container overflow-hidden" id="GamesListContainer20" data-sortfilter="0" data-gamefilter="1" data-minbclevel="0" style="height: 258px; cursor: auto;">
<div class="games-list-header games-filter-changer">
<h2>Battle Network</h2>
</div>
<div class="show-in-multiview-mode-only">
<div class="see-all-button games-filter-changer btn-medium btn-neutral">
See All
</div>
</div>
<div class="games-list">
<div class="show-in-multiview-mode-only">
<div class="horizontally-scrollable" style="height: 168px; left: 0px;">
<div class="game-item">
<div class="always-shown">
<a class="game-item-anchor" rel="external" href="/Battle-Network-Transit-Hub-place?id=147893516">
<span class=""><img class="game-item-image" src="http://t1.rbxcdn.com/d36424dceab83ed45eb7b4fab8e97c15"></span>
<div class="game-name notranslate">Battlenetwork Hub</div>
</a>
<span class="online-player roblox-player-text" style="float: left"></span>
<div class="show-on-hover-only deemphasized hidden">
<div class="creator-name notranslate">
by <a href="/User.aspx?ID=56766433">Battlenetwork</a>
</div>
</div>
</div>
</div>
</div>
<div class="scroller prev hidden">
<div class="arrow">
<img src="http://images.rbxcdn.com/bf9c0660cdeb6283b71aa9237716519e.png">
</div>
</div>
<div class="scroller next">
<div class="arrow">
<img src="http://images.rbxcdn.com/ab6e44a9d9ebfde2244da961275acd06.png">
</div>
</div>
</div>
<div class="ad-spacer"></div>
</div>
</div>
...at the top of a division with id="GamesListsContainer"
on the website "http://www.roblox.com/games/"
Is this possible? Any advice? Again, this is in a Chrome extension, I have the popup.html and stuff.