Modify HTML before Chrome native scripts - javascript

How do I modify the HTML page before any Chrome runs its scripts, or
make my script run before any source script, once Chrome gets the whole HTML plain text.
Can any Chrome API do that?

Related

Breakpoints in embedded scripts

I'm trying V8 out in a small test environment, where I have a custom html, with embedded JS scripts. I'm connecting to the Dev Tools trough Websocket, and its working well except for the Script debugger panel.
I'm creating the ScriptOrigin like this:
v8::ScriptOrigin{ fileNameValue, lineNumValue, colNumValue }
fileNameValue can be the same for multiple scripts, as there are many embedded scripts in a file.
The DevTools only shows one entry for each fileNameValue I submit, but it only displays the content of the last submitted script.
Is there a way to provide the full html, along with the embedded scripts, and map the scripts with the lineNum and colNum values?

How to add third-party scripts in a Chrome Extension that runs inside Gmail to develop a #mentions feature

I am trying to develop a #mentions feature in my Chrome Extension, using jquery atwho (https://ourcodeworld.com/articles/read/516/how-to-create-a-mentions-autocomplete-with-jquery-and-atwho). This Extension runs changing Gmail Interface. I have comment box inside a popup, which I want to have the atwho feature. What is the correct way to insert these scripts in my code? (Should I push the script in the header of Gmail, or is there some other way?). (Usually all the other third-parties scripts I use, are in a vendor.js file and are not pushed in the header of the page).
Initially, trying to insert the script in the header, I get an error that jQuery is undefined. After I also insert the script in the header of Gmail, my Extension does not load correct.

Edit Attribute of External Webpage on Client-Side

I am trying to create a program that can edit an attribute of a webpage automatically just like the chrome developer tools can do with changing around the code of a webpage on the client-side until it is refreshed. I have a web server running php that could possibly be utilized or I was wondering if a chrome extension running javascript could.
Basically, I want to change the attribute of a certain tag on a certain webpage automatically.
Edit: I want to change the source of an iframe tag to a different webpage.

Javascript file reference in debugger missing

I am not exactly certain what I did to cause this, but I have been able to, up until a couple of minutes ago,debug my javaScript file(referenced using a script tag in a .aspx page I am working with) using FireFox firebug tools. Suddenly, I am unable to view the file via the FireFox script tab list. I scroll the list of script files included in my page, but I do not see the particular Javascript file I expect to be on the list. I am however, able to confirm that the JavaScript file is loaded along with the page information, under the HTML tag in firefox.
**No Javascript on this page**
If <script> tags have a "type" attribute, it should equal "text/javascript" or "application/javascript". Also scripts must be parsable (syntactically correct).
I experience similar problem when using chrome. When I pull up the entirely loaded file, I am able to confirm that my javaScript file is correctly referenced. But for some reason I am unable to verify the script is being run or debug it.
The rest of the web application works file. Problem is just with the one page.
ONE SOLUTION
I created a new aspx file. Copied over the code from the faulty page and ran it, and it worked fine on both Firefox and chrome.

IE9 iFrame Ignores js files

I have a very strange problem with IE9 and an iFrame I've implemanted inside an aspx page
the iFrame is connected to a login page of a different website and when i try to log in with username and password, the login page that supposed to call several js methods on external js files, well, doesn't call them
naturally, I've checked this page in FF and Chrome and it works perfectly but IE9 (and IE9 with competability mode) cant seems to "see" these js files
I opened IE tools (F12) and looked in the "script" tab, the external script weren't there
I've tried to link the scripts in my aspx file and it didn't help either
so what do you say
why is IE9 can't use js files inside an iFrame

Categories