I think content_scripts is the way to go here. So you actually modify DOM of the page to display your content. You can look in other similar extensions.
For example: StyleBot. Here is how they inject code to the page:
"content_scripts": [{
...
"matches": ["<all_urls>"],
...
"js": [
...
"shared/modalbox/modalbox.js",
And here is code of actual modal box.
this.box = $('<div>', {
id: 'stylebot-modal'
}).append(html);
if (this.options.parent) {
this.box.appendTo(this.options.parent);
}
else {
this.box.appendTo(document.body);
}
this.box.css({
height: this.options.height + '!important',
width: this.options.width + ' !important',
top: this.options.top + ' !important',
left: this.options.left + ' !important'
});
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…