How can I manipulate a web page (re-arranging some HTML controls) through the Browser? - devtools

I want to be able to open my website and use some kind of firefox plugin to re-arrange some Html on the site by drag-and-drop and be able to use that modified source. I used to use a css plug-in but do not remember it anymore. Are there any cool tools or plugins avaiable?

It's not drag-and-drop, but Firebug will let you modify any web page in Firefox. You'll have to edit the HTML/CSS source directly, though; once you're done, you should be able to copy and paste into a text editor.

Related

How to open a browser within VSCode just like another editor tab

For a VSCode extension i want open browser within VSCode not externally, wherein i can load some URL (https://developers.redhat.com/)
I tried looking into various options to achieve it in VScode extension, what i came across is with help of webview i.e 'vscode.previewHtml' we can pass html content which would be rendered with in VSCode editor tab, but what i have is url to load. Can pass it to iframe but i can't open it in iframe
Another option is to open it in browser but it opens external browser.
what i need is to open a browser within IDE (VSCode), experience should be similar to what we get for 'vscode.previewHtml'
or as we see in IDEs like eclipse where browser window is opened right inside IDE.
As we can see below
Please give inputs, suggestions
It's possible now without extension. Open command palette (CTRL+P) and search for "Simple Browser: Show".
This is how it looks:
In order to render your html you can use the WebView API:
https://code.visualstudio.com/docs/extensions/webview
Microsoft has an extension in development, Live Preview. I use it to view html codecov reports inside of VSCODE and it at least works for that.
You just search for it in extensions and add it to VSCODE

Whitelist Chrome fonts via extension

I'm looking for a way to whitelist fonts that pages in Chrome can use. In Firefox I would just simply disable Allow pages to choose their own fonts, instead of my selections above in content settings but Chrome seems to be keen on letting web designers force ugly and often unreadable fonts on us.
I don't want to use * { font-family: sans; } style in Stylish, because I want to keep sans (or serif) and monospace sections, and web designers, insane as they are, usually keep those at the end of the font-family list.
I've done my research and I still can't figure out how to do it via Chrome extension API.
I considered intercepting requests for CSS files and modifying them in response but this isn't possible via current API.
I could also traverse the DOM tree, inspect CSS on each node and replace it appropriately but it'd expensive. Moreover this wouldn't work for pages which build the content from JavaScript. So I'd have to use MutationObservers and that would be way too expensive.
If I could somehow read CSS files that the current tab is using, I could collect the rules with font-family style and inject appropriate <style> element into the page via content script. But I couldn't find a way to read those CSS file via current API. (I'd also have to read <style> rules embedded in HTML but that's doable).
I could also do it via some proxy but I'm not sure how to (securely) cope with SSL.
I could get close with fontconfig. It gets rid of Arial but doesn't work for external (and usually most ugly) CSS fonts.
Is it possible to achieve my goal via current Chrome extension API? How? If not, what would be the workaround?
I don't care about inline styles and styles set from JavaScript. I can live with those. Vast majority of pages I'm concerned about use styles from external stylesheets.
EDIT
wOxxOm's advice to modify document.styleSheets is the way to do it and I've made a simple extension that worked on all sites! Unfortunately, in current Chrome, CSSStyleSheet#cssRules returns null for stylesheets loaded outside of page origin https://code.google.com/p/chromium/issues/detail?id=45786. T_T
(I'll of course publish the extension on GitHub and post the link here after I polish it).
EDIT 2
As wOxxOm suggested, blocking web fonts is also an option (though less ideal I'd say) and there even exist good open source extension for it https://chrome.google.com/webstore/detail/disable-web-fonts/olmabeadgbpmhllgdkemfdnmkngkbkeg. It needs some white list for iconic fonts though. Local fonts can then be managed via fontconfig.
This issue is probably related to ugly looking web fonts https://code.google.com/p/chromium/issues/detail?id=173207.
EDIT 3
I ended up with this nice (and open source) extension https://chrome.google.com/webstore/detail/font-blocker/knpgaobajhnhgkhhoopjepghknapnikl. It's a blacklist but that's enough for my needs and it works with iconic fonts. As far as I can tell, to implement a font whitelist extension I'd have to be able to enumerate all fonts loaded by a web page and that appears to be impossible in current Chrome (see first edit).

what browser plugin that lets you override html of a website automatically

Can anyone suggest a browser plugin that will let me override a website whenever I am loading a particular website.
Example Scenario:
Whenever I load yahoo.com I want to change on how it renders the html and behave.
It needs to be able to manipulate the DOM. example, it can change the attribute of an <img height="" width="" />, example the width and height of the image.
Aside from changing attributes it also need to be able to inject new elements. example i can insert new <divs> or <p>.
I also need to be able to manipulate the head tag as I like to insert external CSS and JS for the overrides.
I primarily use Google Chrome and Mozilla Firefox.
Thank You.
Chrome has native support and Firefox via a plugin for user scripts (also called greasemonkey scripts). They are essentially javascript files that are installed like an extension. At the top you define the domains for your script to run on and you have access to modify the DOM. There are lots of examples at http://userscripts.org/ . Load a few in chrome and then take a look at the user.js file source to see how they work.
You could also do it via a Bookmarklet, however they are more of a hack compared to Greasemonkey scripts
It's called the content scripts in Chrome extension.

Embed wiki content in a website

I want to have a few of my webpages to be in wiki format. I tried using Moin moin, and embeded it on a webpage with html iframe tag. But it loads the entire wiki page with the header and footer. I want to embed just the wikicontent without the header, footer and the sidebar. For the website I use django frame work. Are there any wiki plugings that work well with the custom templates? Or are there any wiki apps which just output content/body part of a page?
There is surely an easy way to do this. I suggest you ask in the MoinMoin forums.
With Tiki Wiki CMS Groupware, a page like:
http://doc.tiki.org/Draw
Is visible in an iframe-friendly format using:
http://doc.tiki.org/tiki-index_p.php?page=Draw
Check out dooWikis where you can embed just the wiki into your page so that it looks like your own. You can also turn the "Edit" link on or off depending whether or not you want to make it look like a wiki.
You can use lightweight wiki-embedded specially designed to be embedded inside webpages. It supports Markdown language, it is self-contained and does not require page reload while browsing and editing wiki.

is there a firefox addon that provides jsFiddle like features

I just saw jsFiddle today and am wondering that is there a FireFox addon that provides jsFiddle like features. Especially when you enter the html and css, jsFiddle shows you a layout of the page. Is there any addon that shows such layout for "offline viewing"? I use Firebug but there isn't such layout. Does somebody know about it?
Not a firefox add-on, only in the interest of self-promotion:
I have created a Vim script with similar (but at the moment very limited) functionality: vimfiddler. Vim integrates with selenium to drive a browser. Provides a jsfiddlerish experience running locally on your own computer.
In Google Chrome you can edit every element of the page. Just open a new tab, hit F-12 and edit to your heart's desire. Add some css or javascript to the head tags, put whatever HTML you want in the body, and you're good to go.
This add-on sounds like what you need : https://addons.mozilla.org/en-us/firefox/addon/devtools-prototyper/?src=ss
Just install it, open the devtools, then switch to the "Prototyper" tab.

Resources