Editing js source file with extension

173 views
Skip to first unread message

Draco D. R.

unread,
Nov 15, 2016, 5:52:52 PM11/15/16
to Chromium-Extensions-Announce
How would one change a js source file from a page and reload it back into the page through a chrome extension? I know you can edit source files with DevTools, but how do you do it with an extension? Thank you

Antony Sargent

unread,
Nov 16, 2016, 1:40:23 PM11/16/16
to Draco D. R., Chromium-Extensions-Announce
The closest thing to that is probably content scripts and/or tabs.executeScript - both let you operate on the page's DOM from an "isolated world" javascript context, but if you need to modify the page's regular javascript context you can inject <script> tags into the DOM. 


If you only want to automate something in developer tools, extensions can provide additional functionality when devtools are open; see here for those APIs:




On Tue, Nov 15, 2016 at 2:52 PM, Draco D. R. <likel...@gmail.com> wrote:
How would one change a js source file from a page and reload it back into the page through a chrome extension? I know you can edit source files with DevTools, but how do you do it with an extension? Thank you

--
You received this message because you are subscribed to the Google Groups "Chromium-Extensions-Announce" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extensions+unsub...@chromium.org.
To post to this group, send email to chromium-extensions@chromium.org.
Visit this group at https://groups.google.com/a/chromium.org/group/chromium-extensions/.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/1e645b10-1015-4bfa-8192-f97a3245cb6d%40chromium.org.
For more options, visit https://groups.google.com/a/chromium.org/d/optout.

Reply all
Reply to author
Forward
0 new messages