chrome extension shouldn't load (or block) scripts of the DOM - dom

is it possible to block all of a website before they are loaded?
I can remove all after the DOM is done but events declared with these scripts are still happening which I would like to prevent.
Thanks!

If you want to block a site's javascript wholesale, you can do that without any extensions. Go to Preferences -> Under the hood -> Content settings -> Javascript -> Manage exceptions. From there you can add a rule to block the site from running javascript.

Related

Chrome Developer Tools not working with popups

I need to examine the HTML of a popup, which works by injecting new HTML into the document. However, if you off-click the popup it automatically closes. Chrome's Developer Tools requires you to change focus to that window, which causes an off-click.
I have figured out a workaround that helps but is ultimately insufficient. You can right-click on the injected HTML in DevTool's Elements tab, which allows you to copy the injected HTML before the browser recognizes the off-click. This helps, but doesn't allow you to fully examine the injected HTML.
(The following solution is insufficent)
Is there a solution that allows me to fully examine the popup's HTML?

office js change DOM loaded in task pane

I'm developing an office add-in using office-js (not using VSTO) and I want to access the DOM loaded in the task pane from the java script function-file used in the manifest extension points .
Yes, you can access the DOM loaded in the task pane from your JavaScript function-file. Think of it as if you have two browser windows or tabs and you want to communicate between them. Since the windows don't have access to a reference for one another, postMessage isn't a good solution. One option would be to use localStorage, which triggers an event on all same-domain pages when it changes.
Yes, you can access the DOM loaded in the task pane from your JavaScript function-file. Think of it as if you have two browser windows or tabs and you want to communicate between them. One option would be to use the postMessage() API to notify the task pane and include any information you'd like.
Edit: see my other answer: this solution isn't feasible since the window reference isn't available.

Chrome Extension (Content Script) Caching CSS

I'm writing an extremely simple extension which applies some CSS to facebook's root, i.e: http://www.facebook.com/ only. When the user navigates to another page the CSS should not be applied, however it appears that the file is cached and applies to all other pages until a full refresh (F5, etc) is pressed, rendering the extension useless.
Would there be a simple solution to prevent caching for a particular page - or - some javascript to run such as window.reload? This may be a facebook particular issue.
The Google Chrome extension never cache css. Actually, Facebook use Ajax call to update its content. So most of the time you are on the same page with a different content.
The best way to have a local change is to use javascript script with "document_end" injection. You can use DOM events to detect changes.

is there a provisioning for inspecting a winJs html file

winJs application are simple html Applications. Xaml c# provides an interface view where we can look at the design drag drop elements.
Is there a Way to Debug a winJS application like firebug or inspect element in Google Chrome. running every time in the simulator to check whether code is working or not has become a tedious Job. Any alternative please suggest.
Yes there's a kind of firebug as you mentioned But it is also known as Dom Explorer
The DOM Explorer is available only while in debug mode.
Make sure you have the script debugger selected, start debugging (F5), then go to Debug -> Windows -> DOM Explorer.
Here's a link to study the details
Dom Explorer from MSDN

Load firebreath plugin in Firefox extension without injecting anything in DOM

Is there any way to load firebreath plugin in firefox extension.I've seen one way by injecting html related to plugin into DOM as explain here(see "http://stackoverflow.com/questions/5688904/scriptable-npapi-plugin-doesnt-work-with-firefox")
I think its better that extension will load plugin in background to avoid any security issues.
my plugin has nothing to do with drawing, its just send data to a specific port by calling a simple function.I'm new to extension development so any example will be helpful...
Sounds like you figured it out, but for the sake of any who find this question with the same issue: a NPAPI-based plugin (FireBreath or otherwise) can only be loaded inside of a DOM; however, in the case of a firefox extension (or Chrome extension for that matter) it doesn't have to neccesarily be the DOM of the web page, it could also be the DOM of the extension.
In this case, you can load the plugin in the XUL file.
It's also worth checking out this thread:
Using a plugin generated with Firebreath in a Firefox Extension?