Security settings in IE that cause not loading all page components - ajax

The situation is this: site was added as trusted in IE, I'm able to open it, but not all components in a webpage are visible. The page contains multiple tabs (that use AJAX), with a tab as default. When trying to access other tabs, they appear empty (tab content doesn't load). So, always only the default tab opens with loaded content, the others don't.
What security settings in IE can cause this?

You have to enable "active scripting" and allow the browser to run safe ActiveX modules in older versions of IE. The usual work-around involves using an iframe for IE since most people will not add the domain to the trusted domain list and deal with all of IE's warnings about security being lowered (or they don't have access to those settings in their workstations because of a group policy set by IT).
After IE 6 they started using the standards approach... check out this reference from Microsoft on the XMLHTTP object.
Also you have to actually be able to call the other windows by name in your instance (since there is no main DOM-accessible listing of available windows and tabs), which means that you would need to have opened them from the initial window so you can setup the Javascript reference as a reusable variable.
var Window1 = window.open();

Related

How do I view and edit local storage used by WebExtensions based Firefox addon?

So I am developing a WebExtensions based add-on for Firefox. My add-on successfully stores and later retrieves some cruft (using browser.storage.local.set()/get(). But how can I view and edit the contents interactively (using keyboard and mouse), and not using WebExtension code? For example, to quickly modify some stored object properties and/or values by hand, for quick testing?
I figured I'd try, "Storage Inspector", SHIFT-F9 or Menu -> Web Developer -> Storage Inspector. But there's nothing there. I have one tab open which is on about:addons page, and Storage Inspector just has "about:addons" in each section (Cache Storage, Cookies, Indexed DB, Local Storage [I want this] and Session Storage). But they seem tied to the about:addons page, tied to whatever tab the Storage Inspector was opened from.
Hmm, so I click on my Options page, which I configure to open in a tab, and every storage area has moz-extension://random-uuid-etc, which is not the ID of my Addon, presumably because I started the browser session with the web-ext which injects the addon into a profile, for live updates on file changes.
I know, you're saying, but, that will create a new profile each time, so you won't have any old values saved anyways. Sure, ok, that might be an excuse if I hadn't already set stuff with the add-on before trying to find a way to view and edit. So really that's not an excuse for the local storage to be totally blank in storage inspector.
But additionally, I am using web-ext with -p C:\path\to\profile --keep-profile-changes, which stores profile changes in a persistent manner. I have verified that values previously saved from the add-on remain in local storage, even after commenting out the call to set, exiting, saving file, restarting, etc.
So how do I view and edit local storage used by a WebExtension based Firefox addon?
A "Web Developer" tool that has a caveat of not working for web development, is a prized dunsel in any toolkit.
Currently this isn't possible in Firefox. Vote for https://bugzilla.mozilla.org/show_bug.cgi?id=1292234 to make it happen one day.
In the mean time, I use Chrome for Firefox WebExtensions development where the Storage Area Explorer extension offers the feature you're looking for.
In FF 60esr I can view extension local storage data in the page rendered by navigating to about:debugging and selecting debug on the extension in question. The URL is of the form moz-extension://{Extension UUID}/_generated_background_page.html and it is possible to navigate directly to it. As you would expect, local storage data appears in Web Developer/Storage Inspector - example below.
As for editing it, The GUI needs some improvement, but this is possible by double-clicking in either a key or value field, as per the docs.

Content Script Injection at Install for Firefox Web Extension

If content scripts are specified in manifest.json for Firefox, Firefox will also load content scripts for already opened tabs and execute them even the tabs are already in loaded and ready state.
Google Chrome does not add any content script when extension is installed for already opened tabs. The content script is loaded when the page is refreshed for the older tabs.
I want to ask is Firefox's behavior is expected or bug?
As far as compatibility goes, it's a bug.
Chrome does not do that.
As a result, many extensions implement custom logic to achieve the effect.
One has to take into account side effects. Suppose your content script injects some UI into the page. Then the extension is updated. That amounts to extension restart, and suddenly you have 2 copies of the UI. Also valid if you just attach event listeners, as (at least in case of Chrome) the old content script's context continues to exist (in an "orphaned" state).
The last point is very important and probably the reason why Chrome doesn't do it by default. At some point I made a very long post about this problem - if you're going to report this as a bug to Mozilla, please include that. There's also this feature request that is related.
What would be sensible (and backwards compatible) is to add a parameter to content script description in the manifest - whether to inject into existing pages. It will be up to developers to guarantee that side effects are taken care of. This usually requires even more code to just communicate to the old script that it needs to wind down and clean up.

Force System.Windows.Forms.WebBrowser open in standard mode

I'm developing a client windows form application. the application must browse URLs provided by servers in a System.Windows.Forms.WebBrowser control.
The problem is when Navigating Document Mode is set to Quirks and a "Http Status 403" is shown instead of the requested Page.
How to force webBrowser to open in standard mode without changing the registry?
Have you tried setting the FEATURE_BROWSER_EMULATION feature control got your application's executable filename?
Remember that the default values for a number of feature controls vary between IE and applications hosting the webbrowser control. If you see different behavior when rendering the same content, it's possible that a feature control needs to be adjusted.
Hope this helps...
-- Lance

Creating options page for BHO

I am creating an IE browser extension using BHO,
I would like to create an option page like the on chrome or firefox.
I want this page to be accessible using manage add-ons page like it works in chrome and firefox. Is it possible? how do I do that?
I am using visual studio ATL and c++
Your Best Best is adding Context Menu or Tools Menu Item.
Basically There is no Standard IE Options Dialog that you can merge your stuff into.
you are gone have to have your own dialog.
as a warning starting with IE10 and IE11. your IE-Addons (BHO,Menu,Toolbar,DeskBank) will not have any access to registry or file system.
if you need to save some stuff. you are gone have to probably create a broker process.
for instance you need to create a windows service that listen on a socket (maybe some random port) and yo you can communicate with it from your options dialog on what to save and what to read.
Inserting context Menus into IE
Inserting Menu Options

Firefox addon to remove cache and cookies of one domain?

I use Firefox to develop a web site and at the same time to browse the web, read my gmail, etc.
The problem is every now and then I need to delete the cache and or remove the cookies of the web app, but I want to stayed logged in in the other web pages I am visiting.
Do you know a Firefox plugin (or Firefox trick) that can help with this issue?
Preferences → Privacy → remove individual cookies
They are grouped by domain, and you can eliminate all cookies from selected domain with one click.
Update:
Option → Privacy → remove individual cookies
There are two add-ons for FF that every web developer needs and they are Web Developer Toolbar and Firebug, the Firebug extension YSlow comes in very handy too.
Web Developer Toolbar has great cache and cookie control down to individual cookies. Firebug lets you mess with the DOM and CSS directly for a page and YSlow is good for page weight and response times.
Be careful having Firebug enabled for JavaScript heavy sites as they really slow down. GMail will warn you about this and tell you to turn it off. I have had a problem trying to disbable sites with the menus when the tool is embedded in the browser at the bottom but opening it in its own windows the sites menu works fine.
I personnaly also like IE Tab which means I can quickly view a page in IE without leaving FF and I can also get it to load anything that only works in IE with it.
Cookie Monster might work?. Also, have you considered just using two profiles in Firefox? You could setup two profiles with two icons and use one profile for the website and the other for the non-development. The only problem would be you can only have one open at once.
Also, two browsers (Chrome, IE, Firefox, etc) might work well too.
WebDeveloper extension allows to delete cookies for domain. It also can clear cache, although for me Ctrl-F5 is enough usually.
I had the same problem and found a firefox addon to remove the cookies for the current site that you are displaying:
https://addons.mozilla.org/en-US/firefox/addon/remove-cookies-for-site/
Using that I don't have to navigate the firefox menus to find my site in the list (which was too time consuming). This does not cover the cache-issue. For that there is the Ctrl+F5 other people have mentioned. It is covered in good detail here:
What requests do browsers' "F5" and "Ctrl + F5" refreshes generate?
Best solution:
1) Just Click CTRL+H and search the site.
2) right click on it and choose Forget About this site
(source: https://superuser.com/a/733154/249349 )
If you would like to use firefox, clear cache and cookies for one domain and stay logged in (and retain cache) at other sites, you could run a second firefox profile concurrently using the '-no-remote' parameter. I use this all the time to view sites I am building from an anonymous and administrative perspective at the same time.
One way to do this (in windows xp) is: make two profiles, then startmenu->run type 'firefox -profilemanager', untick the 'don't ask next time' box and load profile 1, then startmenu->run type 'firefox -no-remote' and load profile 2. You should now have two seperate firefox profiles running.
Clearing cookies for a single domain is easy with any one of a number of tools. Clearing the cache for a single domain or at the individual page level is sometimes useful, but hasn't turned out so easy for me thus far.
One specific situation is changing a meta redirect, where you can't just ctrl-F5 (you're being redirected, after all). Using a different profile isn't an acceptable general solution. Web Developer toolbar can disable the cache to test that the change is working but it's only a temporary fix, and not one that can readily be suggested to a client in order for them to view the change.
I use SQLite Manager for firefox to remove single sites from cache. All you have to do is open places.sqlite in your user profile folder using this plugin and remove the site. It's not exactly an easy solution but it does work. Make sure you backup your profile 1st!
Ross, I have the perfect answer for you. Get on the current tab that you want cookies cleared. Click tools > Page Info. Or install Page Info Forms & links for a shortcut. Then click the Security Tab. Then View Cookies button. It will bring up all the cookies for the relevant domain. Click the ones you want to delete, and click remove.
Seems we have cookies covered here.
As for cache, the trick is to make your development server force a refresh.
In httpd, you probably have some some cache directives to swap out for these:
Header set Cache-Control "no-cache, must-revalidate"
ExpiresActive On
ExpiresDefault "now"
In header:
<meta http-equiv="cache-control" content="no-cache, no store"/>
The benefit of doing it the httpd way is that your scripts/images/css get refreshed.
In that way you are not restricting yourself to just browser with web developer toolbar, you can use other browsers such as chrome that does not do the no-cache thing so easily.
Another extension that handles the cookie part of the question with a little more ease than the rest is Close'n forget
https://addons.mozilla.org/en-US/firefox/addon/closen-forget
You can use it by toolbar button/context menu/keyboard shortcut in order to close the current page, discarding any cookies it held.
Optionally, the site can be removed from browser history and (again optionally) all the pages you visited in the current page can be removed from browser history too.
Simple solution is simple - use two different browsers.
Say chrome for your email and Firefox for dev.
Also, you have Cookie Swap. but it doesn't really work quite as smoothly as you'd like.

Resources