Change JavaScript files on Google Chrome's Developer Tools [closed] - javascript

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I know how to use JavaScript on Google Chrome's console.
But is it possible to edit JavaScript files from within Google Chrome's developer tools and see the changes immediately? If so, how?
I have tried changing the code, but it has no effect on the page.

You can edit javascript of the page. You had to make a double click in the old version of chrome or in the recent version you need to make a single click in js file. After that you need to press Ctrl+S or Cmd+S on Mac.
Then DevTools will send the changed code to V8.
If you are in a debug session and stay on a pause in a function you can edit it and after Ctrl+S v8 will move the execution point out from the edited function so you will be able to pass it again.

You could redefine a global function or change the value of a variable in scope, but I'm not aware of any way in the Chrome Dev Tools to edit your code while live. I edit, then hit refresh.
You can live edit CSS in the Sources tab.

Related

How to view the javascript code in chrome? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
When I go to others' page, I want to see the Javascript code how others write.
Can I view the js code by right click and inspect (chrome) , I know html and css can be seen, but how about js code?
Open up your browser developer tools and go to the Network tab, then load a page. Select the "Type" column, and then you can examine those with a Type of script. For example, on Stack Overflow, you'll see something like:
As you can see, Stack Exchange loads jQuery, a script named stub.en.js, a script named clc.min.js, and a few more. To see what those scripts contain, either click on them in the Network tab, or right-click and select "Open in new tab" to view it as a standalone tab.
But professional sites often minify their Javascript, and complicated minified Javascript is very difficult to read. Better to read source code whenever possible, not distribution code, to save yourself a headache.

Where does the element gets style in javascript? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I'm working on a template that has various javascript files and plugins.
I want to know in witch javascript file the element get styles and in which line it has been declared
Assuming that the Javascript gets rendered: open your page in Chrome. Press F12 to open the development tools.
Click the 'search' icon at the left side of the bar, and hover your element. The "Styles" bar at the right side shows which CSS file is used to render the element.
open your template in browser.
Right click on your desired element.
Choose inspect element.
There you can find the file name in which element in written, style sheet file name and line number if it has.
Use developer console in chrome or firefox to debug and look over the javascript files and use breakpoints for checking the javascript files.
press F12 in chrome to get to developer tools and select Sources, navigate to javascript file which you need to debug.

Browser keep loading and never stop [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 years ago.
Improve this question
From the Chrome developer tool, I can find any error in console, but how can I debug using Chrome to check which script causes the browser keep loading? The problem website is at http://www.852ebiz.com/vote/ph/
How can I debug using Chrome to check which script causes the browser keep loading?
Open Chrome
Press Ctrl+Shift+I (Cmd+Shift+I on a Mac) to open the Chrome Dev Tools (F12 also works)
Click the Network tab
Paste the URL in the address bar and press enter
Watch the various HTTP requests, and look for the ones that continue to show "(pending)" for a long period of time
The Timeline column can also be very helpful identifying what's taking time to load.

Javascript [virus?] added automatically on every page [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I don't know if this is any kind of virus, but lately i've been seeing stuff that i did not add to my browser, at first i thought thoses were code added to my webpages but now i see them on all webpages (including this one).
this is the javascript added:
<script type="application/x-javascript" src="http://i.swebdpjs.info/opt_content.js?v=opt_1410177193622&partner=sweb&channel=sweb&sset=2&appTitle=&sset=2&ip=190.199.222.1"></script>
there are more added but this one is an example, i cannot tell which one are from stackoverflow but i recognize this one because it appears on every page.
i analyzed my pc with nod32 and it does not find any virus threat and analyzed with CCleaner
any way to fix this?
Check your browser extensions and add-ons. It's possible one of those is injecting this Javascript into every page.
Also try opening your browser in Incognito mode to see if it happens then. Browser extensions and add-ons are disabled during incognito (or private browsing) mode.
It is also possible that your ISP is inserting this into every page. In wich case we could do other things to stop this behavior.

Enable/Disable Javascript in Firefox 23 [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
How to enable/disable JavaScript in Firefox-23.
I did check the release notes of Firefox-23 it says, "Enable JavaScript" preference checkbox has been removed and user-set values will be reset to the default.
I have been using the enable/disable JavaScript feature to check if my developing website behaves as expected without JS. How do I disable JavaScript now. As of now am using web developer add-on, but, I don't want to use it as it fills most of my webpage. Looking for an alternative.
Why this feature was removed.?
https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/23 says:
You may still disable JavaScript by double clicking the "javascript.enabled" option in about:config.
Other choices are the noscript plugin, or next generation devtools.
Why this feature was removed?
See Bug 851702 and the linked ones, especially Get rid of options that kill our product ("checkboxes that kill").
If you type about:config in your URL bar, and search for 'javascript' there is an entry javascript.enabled which you can set to false or true.
You could use the Firefox add-on "YesScript" which allows you to disable JavaScript on certain sites only.

Categories