How to empty the back-history in firefox tab? - firefox

After a day of SO my back history of the firefox tab is pretty long.
How can I empty it, without closing the tab and opening it again? Can I run a GreaseMonkey script to do that?
Edit:
After following the ideas of Noitidart, I now have in the scratchpad the history (window.history) with window.history.length elements. I can go back and forth. But how do I empty it?

Awesome question. I think the only way is to make a firefox addon its a very simple one to make.
Here is some code you can run from scratchpad. https://www.youtube.com/watch?v=oo4STWceGTM
I think it will work from greasmeonkey too.
This some HTML5 stuff but i dont think it will affect more then the current:
MDN :: Manipulating the browser history
This is what we will probably need to use:
https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/mozIAsyncHistory
https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsISHistory#PurgeHistory%28%29
https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIBrowserHistory
https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIGlobalHistory
https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIGlobalHistory2
https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIGlobalHistory3
https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsINavHistoryService

Related

Selectors only work when webpage is opened in Internet Explorer

I created a login sequence and my selectors for the input email, password, click login and element exists are valid. But only when I have the Internet Explorer page open on the website I'm working with.
I did that sequence again, and I ran it, initially it worked but when I ran the hole project it broke again, I tried "repair" and "indicate", I tried to eliminate the title but nothing is working.
As far as I can see, you are using selector attribute:
"title=ACME System 1 - Dashboard"
Try using a wildcard: title='ACME System 1*', so it can work when you leave the dashboard.
This worked for me when I took those UiPath Academy courses.
In order to automate tasks within a browser with UiPath, the browser must be open. There is an activity called Open Browser that's included in the default activities for every project. You need to add this activity to the beginning of your sequence and pass in the appropriate parameters, (ie. URL, browser type) you can then pass the outputted browser variable to an attach browser sequence and execute your browser automation acivities within that.
Browser activity sceenshot
In addition, the selector that you have shared does not look like a stable selector. There may be other 'H1' elements on the screen that will cause your automation to fail. I would use the UI explorer to help you build a better, more stable selector.
Did you initially use IE to indicate screen elements and then changed the BrowserType property to use a different browser? Please share the sequence to suggest you a fix for your issue.
I would also suggest you to modify the selector to 'title='ACME System *'.
In order for selector to work the application needs to be open and the desired element needs to be available. So when you close the browser the selector disappears.
You may consider swithching to 'Modern Design Experience' and use 'Use Application/Browser' scope to make this more intuitive, and it will also automatically open the browser for you if it is closed.

Selenium Ruby :tab stopped working when running test

It worked until today, no code got changed
So if I do something like
page.find('#edit-user').native.send_keys(:tab, :tab) it's not working (it's highlighting the element #edit-user but not moving forward) specifically for the tab key, it's working correctly for :space or :enter.
It was working previously, it's a small possibility that it's related to some settings change for the Chrome browser but not sure exactly how and why
We are having this problem in Chrome as well, and it all started with Chrome update 44.
I tried using "\t", :tab, :return, :enter, and :escape to remove focus from a text input (symbols found here), but none of them are working in the most recent version of Chrome.
I know you mentioned you are not looking for solutions other than tab, but short of rolling back your browser version and disabling updates, or waiting for the possibility of a fix from Google itself, you will have to change the scripts being executed.
We found that this has worked well so far:
driver.execute_script("document.activeElement.blur()")
If the desired behavior in your case is to shift focus two fields forward, then you might consider another Javascript solution that looks something like what is discussed in this thread:
simulate the tab key function in javascript
Of course, this probably isn't the best long term solution, as even some very quick Googling shows that sending a tab key to switch focus has been recommended tons of times to people using WebDriver. Because of this, I'm keeping my fingers crossed there will be another Chrome update to revert the behavior.

Code in Firefox about:config variable - what does it do?

Firefox is misbehaving, so I was looking around in about:config, and I stumbled upon something that looks like code. It was in a config variable called extentions.5103ad57a64ad.scode. I'm not familiar with the environment in which this code might run, and it seems to me that it is somewhat obfuscated, but I figure there must be someone here who can figure it out.
For readability, I've put in newlines after most semicolons, and in a few other places; originally, the code was all in one long line.
I'm having trouble with pasting the code and getting the formatting right, so I've uploaded the code to Dropbox here https://dl.dropboxusercontent.com/u/86984895/ff_code.txt
Since my first guess is that the code is malicious, I cleared the variable. It has since reset itself. I do have an idea of how to clean my machine of any malware I may have caught, but I'm still interested in knowing what this code would do, if it were run.
Seems like you have the IETab plus addon installed, which installs adware. When you go to a google page this addon shows price comparison information.
You should uninstall IE Tab Plus and install IE Tab 2, found here:
https://addons.mozilla.org/en-US/firefox/addon/92382/
Or, if you can, don't install IE Tab at all.

HTML5: Remembering location setting in Firefox

I have a page with a Google Maps component, and I am using navigator.geolocation.getCurrentPosition() on initiating the map so that I can show "local" items.
Everything works great, other than the behavior of the location prompt - In the past I thought I had seen where you could choose to allow FireFox to remember this setting, but that has either been removed from FireFox, or there is some flag/setting that I'm not using that would enable this... anyone have any insight?
See this page for a screencap of the 'remember' checkbox:
http://diveintohtml5.info/geolocation.html
Thanks,
Paul
EDIT:
Ok, looks like I am only seeing this issue in FireFox 4, in that it doesn't seem to give me the option to remember the site in the prompt, which means it prompts each and every time. FireFox 3.5 works as expected. Is this expected behavior? I can manually set it to never ask by going into Page Info for the page, but the typical user is not going to know how to do this.
Well, it appears that version 4.0.1 of FF doesn't have the 'remember permission' checkbox... the user will get prompted each and every time they hit the page until they perform the following steps:
Right-Click->'View Page Info'->'Permissions' Tab->'Share Location' and then un-check 'Always ask' set the radio button to 'allow'.
Seems like most people would never know to look there for this setting though, hopefully they re-introduce the dialog 'remember' checkbox.
If you did already gave permission, Firefox will not ask again. You may undo it according http://www.mozilla.com/en/firefox/geolocation/

Firefox extension: Handle file save dialogs

Some of the webpages I visit have stubborn save file dialogs for executables. I would like to do one of the following using an extension:
Save the file by default and close the dialog box. I looked at http://kb.mozillazine.org/File_types_and_download_actions It doesn't really work for these files (the problem is described at: http://kb.mozillazine.org/File_types_and_download_actions under 'Unable to set automatic action. I verified the headers.)
I guess I can use browser.download.manager.closeWhenDone from https:// developer.mozilla.org/en/Download_Manager_preferences , if I figure out the first part :)
Suppress the download manager from showing any such dialogs altogether.
I found https:// developer.mozilla.org/en/nsIDownloadManager#addListener() and https:// developer.mozilla.org/en/Download_Manager_improvements_in_Firefox_3 that look promising. I don't really know how to extract the source URI for the transfer either. I'm curious if anyone has any existing examples for using these or if there's a better way to do this. Or if someone knows what part of Firefox's code I could poke, that would be useful too.
Thanks!
PS: Sorry,I had to break the hyper-links above with an unnecessary space after https:// - apparently I need 10 reputation to do that :)
FWIW, I managed to work around this - though my solution probably wont work for most others.
Fortunately I'm behind a proxy I control, so I just corrected the obnoxious headers (Content-Disposition and Content-Type) before they reached Firefox. These were forcing Firefox to open the File Save Dialog box despite my specified preference to 'Always save file of this type'. Furthermore, I set 'browser.download.manager.closeWhenDone' property to True. Works for me, and I cruise through such sites w.o being interrupted.

Resources