How in chrome/firefox devtool see big style content - google-chrome-devtools

I am working on a website that a script is loading a big chunk of style in the HTML. my problem is the chrome dev tools don't let me view the full script. it's also not available in the resource tab and all chrome is doing is putting three dots while trimming the content. is there any way to view it in the dev tool? even if I copy the style content, it's trimmed version.
the same content in the firefox doesn't even load as something readable.
and I have to copy the content and reformat to see the result. wonder if there is any better way to do this?

In Firefox use Style Editor tab in dev tools. from the official documentation:
The Style Editor enables you to:
View and edit all the stylesheets associated with a page.
Create new stylesheets from scratch and apply them to the page.
Import existing stylesheets and apply them to the page.
You have (at least) 2 options to see this tab:
Hit F12, it will open up the Dev tools for you, then click on Style Editor tab.
Hit Shift + F7, it will open up the Dev tools and active Style Editor tab for you.
After opening the tab, you should be able to see all the stylesheets associated with a page in left pane (The style sheet pane), the name of inline stylesheets normally is something like <inline style sheet #1>, click on it, the content/css will show up in right pane (The editor pane).

Related

How can I remove explorer listitem hover tooltips in VS Code?

I want to remove this suggestion in VS Code which comes on hover, as it disrupts my scrolling.
That area of the UI is called the explorer. What you're seeing is generally called a "tooltip" in UI terminology. Looking through the available settings at the time of this writing, I do not see a setting to disable tooltips for the explorer listitems.
I looked through settings containing "tooltip" and ones starting with explorer. and workbench.list. and didn't find such a configuration point.
If you open the developer tools with the Developer: Toggle Developer Tools command, you'll see that that particular tooltip is just implmeneted with the HTML title attribute. The way that it is rendered is up to the browser, which in this case is chromium, and the particular style it appears in differs by platform / OS.
You might be able to write an extension that removes those title attributes.

Can I write a vscode extension to open a file (from explorer panel) directly in webview?

The behavior I want is that when I click on a file (of certain extension) in the explorer panel, instead of opening a text editor, a webview shows up. An example would be that when I open a .md file, instead of showing the markdown text, a custom made WYSIWYG markdown editor (webview) is shown directly.
I managed to open the webview via command and I even hooked it up to the onDidChangeActiveTextEditor and onDidOpenTextDocument events so that whenever a text editor is opened or focused, the corresponding webView is opened and focused immediately.
This almost does what I want, with two issues. One is that the text editor still shows up for a moment. Second, and more problematic, the webview does not sync with the explorer panel as well as the text editor does. For instance, when a text editor is focused, the corresponding file is selected in the explorer panel. The webview doesn't do that.
Is there a way to make the webview the default and primary editor for a type of document?
This is not possible as of VS Code 1.30. These issue are tracking something similar: https://github.com/Microsoft/vscode/issues/12176 and https://github.com/Microsoft/vscode/issues/22068

How to open files in new tabs in Visual Studio Code

I recently started using Visual Studio Code and I would like to know, is a way to open files in a new tab? Currently whenever I open a new file the files I currently have open disappear. I say new tab, but any option that will let me open a new file in the same window as the old one works.
I have tried disabling Preview Mode through the workbench settings as shown in this answer: How to config vscode to open files always in a new tab?. However, when I choose Open or Open Recent the new file still replaces my old file.
Thanks.
Once you have to open your settings file, add the "workbench.editor.enablePreview" property and set value to false.
For 1.21.1 version.
In user settings =>
"workbench.editor.enablePreview": false,
"workbench.editor.enablePreviewFromQuickOpen"
the best way i found.
Starting with VSCode 1.52 (Nov. 2020), you should not have any more issue: all files will open in new tabs, even in preview mode.
Better handling of preview editors:
Preview editors are now better handled with numerous improvements based on feedback and making this feature work more consistent.
The setting workbench.editor.enablePreviewFromQuickOpen is now disabled by default so that editors opening from quick open will not appear in preview mode anymore.
When you start a navigation (e.g. go to definition), the editor you start from will move out of preview mode to keep it open while the new editor will be in preview mode until you navigate further.
We changed all of our custom trees (the ones used from extensions or Git changes view for example) to work more consistently like our built-in trees (like the explorer).
This means, the following interactions now apply to all of them:
double-click or mouse-middle-click to open non-preview
Enter to open non-preview (Space to open in preview-mode)
Note: if you are the author of an extension that is leveraging our custom tree API, you can benefit from this change as well.
Make sure to use vscode.open or vscode.diff commands for the TreeItem.command and you are in!
A new menu item in the editor overflow menu allows to quickly turn off preview editors altogether:
You need to double click on the name of the file. Also, it needs to be done swiftly elsewhere you will be opening in the same tab.
You can drag and drop file near to the opened tab and the file will open in new tab.
Thanks everyone. Double clicking and dragging was useful, but it still didn't solve my problem when opening files from different projects with the "Open File" menu command. I found that Multi-root Workspaces is what I was looking for. https://code.visualstudio.com/docs/editor/multi-root-workspaces
This is likely due to Visual Studio Code opening file in what's called "Preview Mode", which allows you to quickly view files, ideally if a tab is in Preview Mode then its title in the tab bar, will be italic.
To disable Preview Mode set "workbench.editor.enablePreview": false in your settings file or use the "workbench.editor.enablePreviewFromQuickOpen" option to disable it only from the quick open menu.
Alternatively, use command palette CTL+Shift+P (to get all settings) VScode settings then in User => Workbench => Editor Management you can uncheck Enable Preview and Enable Preview from Quick Open to get the same results described above

Is there a way to search/filter properties in Styles pane of Google Devtools?

On the Elements tab 'Find' functionality (cmd+F/ctrl+F) doesn't search through styles pane. Is there a way to type CSS property with HTML element selected and find it quickly in the Styles panel?
Bottom right corner, light gray text says "Find in styles". Click there and enter your search.
Unfortunately, such functionality does not exist in current Chrome Dev Tools.
But its present in Opera Dragonfly and its very handy, so, probably Chrome will copy it, eventually (but no such feature request exists in bug tracker now).
On the latest Chrome on Mac, I'm getting the filter at the top of the styles pane. I can't believe that I never noticed it given that I've needed it so many times!
Try using CTRL+Shif+F on the Elements tab

Getting Eclipse to open .html in text-editor by default?

Eclipse Juno keeps opening my HTML files in a embedded web-browser, rather than in an embedded syntax-highlighting editor.
I have installed:
Web Page Editor
Eclipse Web Developer Tools
PyDev for Eclipse
Specifically see the screenshot of my install applications.
I need it to work with Django templates + any other Python templates with HTML + normal HTML+JS files.
How do I find this editor, and select it as default?
Select Window -> Preferences from the main Eclipse menu.
Select General -> Editors -> File Associations from the Preferences menu.
For .htm and .html, left click on the extension in the upper view. Left click on the Add button to the right of the lower view to add one or more HTML editors. Left click on your favorite HTML editor and left click on the Default button to make it the default editor.
If the extension you want is missing, left click on the Add button to the right of the upper view to add the extension.
If you want to add an HTML editor to Eclipse:
Go to Help -> Install New Software
Choose the site http://download.eclipse.org/releases/your_eclipse_version
Type the filter text Web Page Editor
There should be one result. Check off the box and press the Finish button.
Now you should have the option to choose the HTML editor when opening files by right-clicking, Open With -> HTML Editor.
If you want to always use the HTML editor to open HTML files then go to the Eclipse preferences -> General -> Editors -> File Associations. Select the extension up top (e.g. *.htm, *.html) then select the HTML editor in the bottom pane and press the Default button.
I had a similar problem.
Once I installed the html editor (thanks to CgodLEY), still my html files wouldnt show up with that editor.
Solution? Right click on the html/htm file, go to "open with" and select "HTML editor". Fortunately that solve everything...
For those still finding their way here, yes, do add an HTML editor to Eclipse as CgodLEY suggests, if you're having this problem. However, even if you already have an HTML editor in your Eclipse installation, consider installing CodeMix for a superlative HTML editing experience - take a look at the differences here.
Now, there's a Django-aware template editor available for free:
http://eclipse.kacprzak.org/
I installed it in Eclipse Kepler / Django 1.6, it's working fine for me.
Note: if you previously opened a specific .HTML file with some other editor, you need to go back to the project view, right click on the .HTML file, select 'open with...' and explicitly select Django editor.
To answer the opening of your question: Note that Eclipse will use the built-in web-browser to view html files if you are opening them outside of a project, as in "File->Open File ...", when that file isn't part of a project.
I just created a dummy project, and now the html files are correctly opened with the editor selected in my preferences. Success!
Nothing worked and I had begun getting an unrelated error on startup with a troubleshooting step requiring reinstall.
This time I downloaded Eclipse for Mobile Developers, and since then I have added my other packages and it's all working fine =).
None of the editors work the way I want them to though, however I have ended up with Django-Editor (which is slightly better than Aptana's one).