can I use the html code highlighter from the browser to my website HTML code color "Inspect element" window code color without any plugins like codemirror?
Yes: all browsers have some kind of inbuilt developers tools that let you inspect a website's HTML, CSS and other components. The shortcut and method for activating them is different for each, but all of them have a 'highlighter' that allows you to click an element on the page in order to inspect it.
Read more here on using developer tools in all broswers -> http://devtoolsecrets.com/
Chrome's developer tools are arguably the most widely known, commonly used and most powerful. Shortcut is SHIFT + CTRL + J.
edit: in light of the comments below, it looks like OP is after a specific feature of Codemirror that lets you highlight syntax. This is not possible natively in browser.
Related
Im currently working on a fork of the famous web developer extension (chrome, firefox, opera). Exactly I am working on the chrome extension.
The Firefox extension is shown like that:
Chrome instead shows only a icon...
..which toggles the "pretty small" widget:
A part of my goal with this fork is to change this toggle icon to a toolbar such as firefox does.
After studying the documentation chrome extensions (https://developer.chrome.com/extensions/devguide) I came to the result that this is not possible with default settings (browser actions, page actions,...).
When I looked again at the Table of Contents in the documentation I got an idea. There is the possibility to edit the bookmarks. So it could be possible to add an additional bookmark bar/row and place the single web developer actions as bookmark with the function on it.
Is this the right way for solving this? Because at the moment I only see possibilities with more or less dirty hacks. And doing it via bookmarks seems at least dirty.
PS: I also thought about this:
The plugin is actually the same on firefox and chrome and from the same author. So when this adaption of the toolbar in chrome would be easy possible then would not have such differences in the chrome and firefox addon.
Nope, that's simply impossible.
Chrome does not support custom toolbars, and that includes "an additional bookmark bar/row".
The closest, visually, would be injecting UI directly into the top of all pages. I don't think I need to explain why that is hacky.
For example, how can I type JS some code that looks like this into the Firefox console:
if (10 > 5) {
alert("Hello world!");
alert("How are you doing today?");
alert("I'm doing great, thanks!")
}
Without resorting to using the space bar or my operating system's clipboard?
I'd like to be able to use the tab key to indent my code in the Firefox console. Whenever I press tab, Firefox goes through all the elements of the browser and web page without indenting my code.
I'm using the console provided by the Ctrl+Shift+K shortcut.
You could use the Scratchpad. It is better-designed for multi-line code editing, and supports using the tab character to indent code.
You can find it under the Developer Tools menu. Tools > Web Developer > Scratchpad on OS X, and Menu > Developer > Scratchpad on other platforms.
You can also add it to the Toolbox under Toolbox Options (the settings gear), and checking the Scratchpad checkbox.
Can try Shift + Tab (not sure if that will work on firefox, but it works in Chrome)
This probably wont answer your question either but it might....
Editor Preferences
Preferences for the CodeMirror source editor, which is included in Firefox and used by several developer tools, including Scratchpad and the Style Editor.
Detect indentation: auto-indent new lines based on the current indentation
Autoclose brackets
Indent using spaces
Tab size
Keybindings: choose the default CodeMirror keybindings, or keybindings from one of several popular editors:
Vim
Emacs
Sublime Text
https://developer.mozilla.org/en-US/docs/Tools/Tools_Toolbox
Just indent. Control + I. Hahahahaha
Chrome/Chromium has a syntax highlighter in the inspector that shows black text while scrolling, and highlights after awhile - unlike Firefox Web Developer Toolbar's, which highlights everything and may take a long time. Since the inspector is written in js/html, is there a way to use this technology elsewhere?
Chrome's Devtools uses CodeMirror for the sources panel where you can edit code. http://codemirror.net
Yes, you can find the source code here:
https://developers.google.com/chrome-developer-tools/
Here are some instructions to get you started.
Also, check out Ace it's very easy to embed and use and does a decent job. Cloud9 uses it.
How to get effective HTML after executing all scripts?
Actually scripts are adding and modifying control and css in the page. I would like to see html of resultant display as a static page. Is there any way to get this?
Edit: Suppose if background image is added using javascript, How can i see in Html OR css?
Please try to get this before giving answer.
One way would be to use Firefox with the Firebug extension.
Firebug is an extension for web developers. Among other things, it offers an "HTML panel":
The HTML panel displays the generated
HTML/XML of the currently opened page.
It differs from the normal source code
view, because it also displays all
manipulations on the DOM tree.
[...]
A similar solution for MS Internet Explorer would be the Internet Explorer Developer Toolbar.
Note that both solution are browser-specific. There is no way to get the resultant HTML independent of the browser used, because this HTML only exists in the working memory of the browser (so you cannot, say, sniff it on the network).
Use the firebug plugin for firefox, with it you can 'view generated source'.
This is a javascript approach. Unfortunately, it doesn't work perfect. For example, it doesn't include the contents of textarea's.
document.documentElement.innerHTML
Another way is selecting everyting (Ctrl + A) and choose 'View selection source' from a context menu.
The Web Developer Toolbar addon for Firefox has a 'View Generated Source' button that let's you do that. It's under the 'View Source' Menu of the toolbar.
It presents manipulated document as a static source, like what the "View Source" option does, but with modification by the Javascript.
Is there a way to view the jQuery (or Javascript) generated HTML - for example, see the jQuery-modified source of a page that uses a number of prepend()'s html()'s etc.?
Use Firebug to look at the current DOM, although it is an interpretation of the HTML.
You can inspect the page with firefox addon FireBug though:
(source: gnucitizen.org)
In addition to Firebug as the other answers suggest, you can also use the built-in Chrome developer tools:
To access the tools you can do it the same way as Firebug, just right click and select Inspect Element.
Download the Web Developer plug-in for FireFox. Then Right click on the page, the select Web Developer -> View Source -> View generated source