keyconfig 20110522

Announce and Discuss the Latest Theme and Extension Releases.
Post Reply
morat
Posts: 6394
Joined: February 3rd, 2009, 6:29 pm

Re: keyconfig 20110522

Post by morat »

Omit.
Last edited by morat on November 18th, 2017, 2:07 am, edited 1 time in total.
Kenosis
Posts: 77
Joined: November 11th, 2011, 5:43 am

Re: keyconfig 20110522

Post by Kenosis »

Thanks for your answers.

I'm not sure if I expressed myself correctly. I want to achieve having two (or more) functions, which are already built-in the browser, combined to one key. The simplest example I'm currently using would be this: F5 + Pos1 set to one single key.

I don't know what more I can say. I mean the above is just a small example. It may even sound ridiculous to you. But for us it has become important. I'm totally willing to try .cfg files, other addons or even a different browers (although it would hurt).
morat
Posts: 6394
Joined: February 3rd, 2009, 6:29 pm

Re: keyconfig 20110522

Post by morat »

Omit.
Last edited by morat on November 18th, 2017, 1:53 am, edited 1 time in total.
Kenosis
Posts: 77
Joined: November 11th, 2011, 5:43 am

Re: keyconfig 20110522

Post by Kenosis »

I don't understand anything. I think this is way too complicated for me. I'm really sorry for wasting your time.

And on top of it, looking at the others answers, I don't even know if there is hope for an addon like keyconfig. Is it even possible? Yes? No? I don't get it.

I am completely lost. Stupid me for expecting an easy answer I guess.
avada
Posts: 1932
Joined: February 10th, 2008, 6:30 am
Location: Hungary

Re: keyconfig 20110522

Post by avada »

Kenosis wrote:I don't understand anything. I think this is way too complicated for me. I'm really sorry for wasting your time.

And on top of it, looking at the others answers, I don't even know if there is hope for an addon like keyconfig. Is it even possible? Yes? No? I don't get it.

I am completely lost. Stupid me for expecting an easy answer I guess.
The easy answer is to downgrade to FF56 and stay on it. Or choose a forked browser that retains legacy addon support. (Basilisk, Pale Moon, Waterfox)
Kenosis
Posts: 77
Joined: November 11th, 2011, 5:43 am

Re: keyconfig 20110522

Post by Kenosis »

As I wrote before, I'm already on FF52 ESR to avoid problems at the moment. But that only works as long as 52ESR is supported. What happens when support for it ends and there are no more security fixes? So staying on an old version is not a solution and i guess you know that.

So, is what keyconfig did so far possible on FF57+ or not. I'm not talking about an available addon, just asking if it is possible at all? I'm coming to a point where I'm totally willing to pay someone to write an addon just for a few key commands... IF it is possible with FF57+ at all.
avada
Posts: 1932
Joined: February 10th, 2008, 6:30 am
Location: Hungary

Re: keyconfig 20110522

Post by avada »

Kenosis wrote:So, is what keyconfig did so far possible on FF57+ or not.
As far as I know it isn't.
Kenosis wrote:But that only works as long as 52ESR is supported. What happens when support for it ends and there are no more security fixes? So staying on an old version is not a solution and i guess you know that.
Only if you're hell bent on upgrading, and you know that. Security fixes are of no significance IMO. Anyway you can use Basilisk and probably Waterfox for a while longer with classic addons.
Patu
Posts: 31
Joined: September 24th, 2008, 2:20 am

Re: keyconfig 20110522

Post by Patu »

I still don’t get it. Is it impossible or is it just too much work to build a new add-on?
nohamelin
Posts: 96
Joined: September 3rd, 2013, 4:04 pm
Location: Chile

Re: keyconfig 20110522

Post by nohamelin »

Not possible.
Bananasik
Posts: 12
Joined: November 7th, 2016, 3:10 am

Re: keyconfig 20110522

Post by Bananasik »

Hello.
Just discovered a bookmarklet, which translate a page thru Google translate, without loading url to google site.
I.e. it grabs text from opened page, send it to a translator and then exchange existing text to translated.
Link
googlesystem.blogspot.ru/2009/11/google-translation-bar.html

Addon which do the same thing
addons.mozilla.org/en-US/firefox/addon/gtranslate/

I want somehow execute this process with a help of keyconfig, with one keystroke, without set parameters on the Google Translation Bar. Is it possible?
ltGuillaume
Posts: 3
Joined: March 30th, 2015, 9:40 am

Re: keyconfig 20110522

Post by ltGuillaume »

I've been trying to open a new tab next to current with the homepage instead of new tab page, and to empty + focus on the urlbar. These are my tries so far, but to no avail.

Code: Select all

var home = Services.prefs.getCharPref("browser.startup.homepage").split("|")[0];
openLinkIn(home, "tab", {inBackground: false, relatedToCurrent: true});
// The following is faster than Firefox itself: after load, FF refreshes the url bar and puts back the URL
gBrowser.addEventListener("load", function() {
  gBrowser.removeEventListener("load", arguments.callee, true);
  gURLBar.value = "";
  focusAndSelectUrlBar();
}, true);

Code: Select all

var home = Services.prefs.getCharPref("browser.startup.homepage").split("|")[0];
var to = gBrowser.mTabContainer.selectedIndex + 1;
var tab = gBrowser.addTab(home);
gBrowser.moveTabTo(tab, to);
gBrowser.selectTabAtIndex(to);
openLocation();
// Sometimes removes already typed stuff
setTimeout(function() { gURLBar.value = ""; }, 250);
morat
Posts: 6394
Joined: February 3rd, 2009, 6:29 pm

Re: keyconfig 20110522

Post by morat »

@Bananasik

There are no parameters in the bookmarklet so I don't know how to change the parameters to non-default values.

Google Translation Bar
http://googlesystem.blogspot.ru/2009/11 ... n-bar.html

Bookmark Builder
http://subsimple.com/bookmarklets/jsbuilder.htm

Example:

Code: Select all

// Header Language: Russian
// Source Language: English
// Target Language: Spanish
var url = "http://translate.google.com/translate?hl=ru&sl=en&tl=es&u=";
url += encodeURIComponent(content.document.location.href);
gBrowser.loadURI(url);
Test page
http://www.mozillazine.org/

@ltGuillaume

Try this:

Code: Select all

var homePage = gHomeButton.getHomePage();
var urls = homePage.split("|");
var index = gBrowser.tabContainer.selectedIndex;
var tab = gBrowser.selectedTab = gBrowser.addTab(urls[0]);
gBrowser.moveTabTo(tab, index + 1);
gBrowser.getBrowserForTab(tab).addEventListener("load", function (event) {
  event.currentTarget.removeEventListener(event.type, arguments.callee, true);
  event.originalTarget.title = "Cowabunga";
  gURLBar.value = "";
  focusAndSelectUrlBar();
}, true);
Bananasik
Posts: 12
Joined: November 7th, 2016, 3:10 am

Re: keyconfig 20110522

Post by Bananasik »

Unfortunately, this time your code is not working.
It reads page from a server and i figure out myself this way, with a help of some addon, years ago.

Real-time translation
googlesystem.blogspot.ru/2009/06/google-toolbar-improved-page.html
can even translate locally saved file and i need it only for this.

So, thank you for try.
morat
Posts: 6394
Joined: February 3rd, 2009, 6:29 pm

Re: keyconfig 20110522

Post by morat »

@Bananasik

You can get a bookmarklet to execute with keyconfig.

http://forums.mozillazine.org/viewtopic ... #p13413833
pintassilgo
Posts: 200
Joined: August 30th, 2013, 3:50 pm

Re: keyconfig 20110522

Post by pintassilgo »

Translate:

Code: Select all

gBrowser.selectedBrowser.messageManager.loadFrameScript('data:,(' + ( function() {
  var d, b, o, v, p, e;
  d = content.document;
  b = d.body;
  e = d.createElement('script');
  e.text = 'Element.prototype.addEventListener=(function(){var cached_function=Element.prototype.addEventListener;return function(){if((arguments[0]=="mouseover" || arguments[0]=="mousemove" || arguments[0]=="mouseout" || arguments[0]=="focus" || arguments[0]=="blur") && arguments[1] == "function(c){return a.call(b.src,b.listener,c)}"){return;};var result=cached_function.apply(this,arguments);return result;};})();';
  e.setAttribute('type', 'text/javascript');
  b.appendChild(e);
  o = d.createElement('script');
  o.setAttribute('src', 'https://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit');
  o.setAttribute('type', 'text/javascript');
  b.appendChild(o);
  v = b.insertBefore(d.createElement('div'), b.firstChild);
  v.id = 'google_translate_element';
  v.style.display = 'none';
  p = d.createElement('script');
  p.text = 'function googleTranslateElementInit(){new google.translate.TranslateElement({pageLanguage:\"\", includedLanguages: \"en,pt\", layout: google.translate.TranslateElement.InlineLayout.SIMPLE},\"google_translate_element\");}';
  p.setAttribute('type', 'text/javascript');
  b.appendChild(p);
} ).toString() + ')()', true);
Yes, it works even with HTTPS and local files.

In my case I'm interested in converting to english (en) or portuguese (pt), change according to your need.
Post Reply