Note that there are some explanatory texts on larger screens.

plurals
  1. POChrome Extension -- Displaying html in the popup
    primarykey
    data
    text
    <p>I was just thinking whether a chrome extension could do this use-case.</p> <p>I have loaded a web-page. Which has some html code on it (I meant the web page itself is also displaying some html code)</p> <p>Like this image.</p> <p><img src="https://i.stack.imgur.com/6SaZk.png" alt="Webpage"></p> <p>This wikipedia contains some html. Which I could extract possibly from doing a regex of html to /html</p> <p>I would like to build a chrome extension that could use this html code on the page (I know how I could extract it through regex) and display it inside a extension popup. It's like invoking a browser itself in the popup. </p> <p>Some link's suggestions would be welcome from where I can start.</p> <p>Could this be done.</p> <p>Update:</p> <p><strong><em>re.js</em></strong></p> <pre><code>chrome.tabs.query( { active: true, lastFocusedWindow: true }, function getHTML(document){ var test = document_r.body; var text = test.textContent; var bodyStart="&lt;BODY"; var bodyEnd="&lt;/BODY&gt;" var regex = bodyStart +"(.*?)"+ bodyEnd; var regexg = new RegExp(regex, "g"); match = regexg.exec(text); return match; } function(array_of_Tabs,document) { var tab = array_of_Tabs[0]; //tab.url; - url of the active tab getHTML(document); chrome.tabs.executeScript(tab.id, {code: "chrome.runtime.sendMessage();"}); }); chrome.runtime.onMessage.addListener(function(request,document) { document.getElementsByTagName('html')[0].innerHTML = request; }); </code></pre> <p>Ok So maybe i can call getHTML in function(array_of_tabs,document) I have the regexed string which contains the html code. Now how do i run that HMTL code in the popup.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload