Is it possible for one to hook onto / access and edit a webpage's contents (like in the inspect element feature) live in chrome using .NET? Can this be done discreetly in the background as well. I don't have any malicious intentions, just creating a simple hack for a game online that relies on its HTML sourcing.
You can use a headless browser like Selenium to do this, they provide an easy .NET library that allows you to interact with a browser programmatically. Also, points for being aware that the question sounds suspicious.
Related
I’m building a simple browser, and I’d like to code most of it using HTML/JS/CSS. I cannot use iframes to display pages, due to frame-busting. What are my options?
The browser is not meant to be production-quality, but as a proof-of-concept for my thesis, similar to this interactive mockup. The main features it will need to support are:
Loading any page without frame-busting (even google.com),
Detecting when a link is clicked and opening it in a new frame, with the original one remaining intact.
I intend to write this using Web technologies, but it’s OK if it needs to be wrapped up in a small amount of something else, e.g., to turn it into an Android app. However, if it’s possible, it would be best if I could load the app as a web page. Finally, it is also preferable to be able to run the app on an Android device, but it’s OK if it only works on a desktop.
In researching this question, I came across a few options:
<iframe>. Google.com doesn't load at all in an iframe. I tried using the sandbox attribute, but it still didn’t load. Is there a way around this (for any page)?
Mozilla’s Browser API. This API was supposed to allow you to use the mozbrowser attribute in an iframe when building FirefoxOS apps. I suspect there’s no longer any way to access it. I couldn’t get the sample browser app loaded, and it seems that mozbrowser is not supported in WebExtensions. Did I miss something? Is there a way to make this work?
<webview> in a Chrome app. This is the only option that worked so far. I was able to download and install the sample browser app in Chrome. The one downside is that it seems to be Chrome-only (and I would prefer cross-platform or Firefox, all else being equal). Are there any issues with this option? Any way to make it run without Chrome?
Electron app with <webview>. While the setup here is more complicated than the previous option, it seems like the code would be very similar (there’s even a similar sample browser app). Are there any advantages/disadvantages to this option over the previous?
So, are there ways to make options 1 or 2 work? Are there perhaps other options?
HTML/CSS is a "language" translated by the browser into pages. You cannot code a browser in HTML. The easiest solution is to code it in C#.
I'm not sure if this is a good solution, but you can try Electron (nodeJS). You will only need to use JS/CSS/HTML.
Is there any way to access the render tree (or the DOM and CSSOM trees) of a page -- programmatically -- before being processed by the rendering engine, in Chrome?
And, ideally, could this be achieved through a Chrome extension, (with any combination of Javascript and/or C++ interfacing with the browser itself)?
Also, this may not be particularly the same but you can see the sequence of the page construction via Chrome dev tools. This is possible by recording the page in the timeline which provides a detailed list of the steps taken to render the page. It is a very extensive list and useful if you would like to take a deeper look. Hope this helps :)
According to
http://www.chromium.org/developers/content-module
The "content" module is located in src\content, and is the core code
needed to render a page using a multi-process sandboxed browser. It
includes all the web platform features (i.e. HTML5) and GPU
acceleration. It does not include Chrome features, i.e.
extensions/autofill/spelling etc. The goal is that any embedder should
be able to build a browser by starting with content, and then pick and
choose Chrome features.
content vs chrome As discussed above, content should only have the
core code needed to render a page. Chrome features use APIs that are
provided by content to filter IPCs and get notified of events that
they require. How to Add New Features (without bloating
RenderView/RenderViewHost/WebContents) describes how to do this.
As an example, here's a (non-exhaustive) list of features that are
Chrome only, and so are not in content. This means that content code
shouldn't have to know anything about them, only providing generic
APIs that they can be built upon.
Extensions
NaCl
ChromeFrame
SpellCheck
Autofill
Sync
Prerendering
Safe Browsing
Translate
Is WebRTC included in Chromium-Content module?
I am not sure, especially, finding jingle directory is outside of content.
Thanks
The webrtc project is included in the <chromium>/src/third_party/webrtc directory.
If you are asking if the components are used in the content_shell target, yes they are. You have access to all the same features with regards to webrtc that you would have in Chromium proper.
I am trying to understand about Chrome (browser) development. I am very new to this and trying to figure out where to start in order to develop for Chrome Browser.
Just have a couple of questions:
What is the difference between Chrome Browser apps vs. plugins vs. extensions (not sure, if this question make sense. But, hope you got what I am asking for)
What kind of applications can I develop for Chrome Browser
What technologies do I need to learn in order to develop for Chrome Browser.
To answer your first question this explains the differences between apps and extensions (I think there's no better way to explain their nature):
https://developers.google.com/chrome/web-store/articles/apps_vs_extensions
What do you mean with "what kind of apps"?
You can develop both hosted and packaged apps if is that what you intended, give a look at this:
https://developers.google.com/chrome/apps/docs/index
Anyway the easiest way to start would be by building an extension, how-tos and
good documentation makes it good to start with:
http://developer.chrome.com/extensions/getstarted.html
Just to add to the above answer which was missing difference between Plugin and Extension is:
Plugin is a third-party library that is plugged-in to the browser and allows for being embedded on a webpage. It affects only the web page that is using the plugin.
Extensions change the browser UI, add menus or change overall look of the browser and can process each page that gets loaded.
So to sum it up - plugins add functionality and extra features to a particular webpage while extensions add functionality and features to the whole browser and change the behavior of the browser.
Just to add on new information since people may continue to hit this question: Chrome has basically deprecated plugins as of March 2017 (Chrome 57). If you go to chrome://plugins now, you won't see anything (you used to see a list of installed plugins with enable-disable links like for extensions).
It seems the reasoning is that the only plugins they actually wanted to allow you to enable/disable are Flash and PDF Viewer, both of which were moved to the Settings menus (if they weren't already there, not sure). The rest are considered to be integral parts of the browser. https://www.ghacks.net/2017/01/29/google-removes-plugin-controls-from-chrome/
Makes things a bit simpler to think about now.
I would like to know if it is possible to modify Chrome or Firefox display settings, so that it would only show rectangles of HTML DOM objects? What I want to do is to decrease rendering engine job amount as much as possible, so it would only build layout of the page.
People usually refer to this mode of operation as "headless" (i.e. without UI).
Usually there's an additional requirement - to be able to run it server-side without the usual for client software installed. If you're running it client-side, I wouldn't bother about optimization, it shouldn't give you a big win anyway.
Otherwise, try searching using that term. I've seen it asked for several times, but haven't seen a working out-of-box solution.
[edit] just saw http://hg.mozilla.org/incubator/offscreen, which seems to be a headless version of Mozilla.
I wouldn't go as low-level as modifying the renderer. Instead, I suggest you use Firefox's Greasemonkey to replace the elements from the page with whatever it is you need. You'll need to know a bit of JavaScript, but it's not that hard.
However, this will only work on client side. If you want to do this on server-side ( so that it will work on any page a user requests through your own ), my guess is you'll need to grab the page's content in a string, and then modify it using a HTML parser.