Smartkeywords in Firefox allow you to set up keyboardshortcuts for your favorite bookmarks. Using a smart keyword, you canenter a short key combination into the location bar, and Firefox willretrieve the desired web site.
When a site contains many different pages with URLs that vary only inpredictable ways, you can use smart keywords to go directly to any ofthese pages by including a variable in your keyword. For example, alldocuments in the Indiana University Knowledge Base have aURL that follows this pattern, where xxxx isthe four-letter document ID:
You can use smart keywords to search web sites fromthe location bar. This will work for any web site that has its ownsearch function, such as Google, CNN, and the Indiana UniversityKnowledge Base. To use smart keywords to search a web site:
Smart keywords are an easy way to search specific websites from the Firefox address bar. Instead of going to the targeted website and navigating to their search, you can start your site-specific search from any site using the address bar.
For example, suppose you search The Internet Movie Database (IMDB) regularly. You can define a smart keyword such as "imdb", then you can search IMDB for information. For example, to search William Shatner, you would enter "imdb William Shatner" in the address bar.
Mozilla Custom Keywords ROCK! Not just for making shorthand for bookmarks but also for searches and queries. Simple keywords allow you to type a short string in the Location Bar and load its corresponding Bookmark URL.
An example is my bookmark for to which I've added the keyword m.o. So, with that set, I can type m.o in the Location Bar and it loads Using keywords combined with autocomplete in Mozilla and I seldom type more than about three or four characters for all of the sites I regularly visit.
To set a keyword you must first create a bookmark for the URL. Then you add the keyword to the bookmark. Open the Bookmark Manager (Ctrl+B), choose your bookmark, and then open the Bookmark Properties window (Ctrl+I, or from the context menu). In the window simply add a short string to the Keyword field. Now close that dialog and you can type the keyword in the Location Bar, hit enter, and Mozilla will load that URL.
There are probably other great uses for this, just try a query at your favorite search engine and look at the URL it generates. If you can replace your search string in that URL with "%s" you can probably make this work. Throw in a little javascript and it's off to the races :)
Firefox no longer supplies a set of default keyword shortcuts, though many people may have started with the above. You can easily add your own keyword shortcuts, such as one to search the MozillaZine Knowledge Base. You need not limit yourself to letters alone, which might be mistaken for search words. Also a keyword of "g:" would be a lot faster to type than the suggestion above of "google".
Note: Firefox users with Add Bookmark Here extension, or the older Open Book extension, can create a bookmark and add keyword property at the same time. An alternative is Keyword addition for Add/Change Bookmark (Fx3)
userstyles.org as a style used with the Stylish extension that can be customized.
By default, %s-replaced query terms are sent to the server in UTF-8 encoding. Some servers, however, use other encoding in their query string, especially in the non-Western environment to result in misinterpreted or garbled query. The mozcharset= parameter has been introduced to work around this problem in Bug 258223.
I'm trying out Chrome, but I use this Firefox feature all the time so I strongly feel its absence. I've searched Extensions and Google in general, but couldn't find anything and don't even know if it's possible to create such an extension. Important: I'm not interested in extensions that require me to click anything to activate the different searches. The important part is it all happens in the URL bar.
If you don't know what this Firefox feature does, briefly: you can assign a keyword to a bookmark and embed %s in the URL. Then, from the URL bar (not the search bar), you can type the keyword and then one or more words to replace %s.
Go into the Options -> Basics Tab -> Manage. You'll see a list of "Search Engines". Some of them are supplied by Google when you install Chrome, others are learned as you use the browser. Double-clicking an entry will let you edit it, where you can change the keyword from the default (domain name) to something shorter or more memorable.
To use your example, I hadn't used
imdb.com yet in my Chrome install. So I went there, used the search, clicked "Go", and got my results. After getting back to the "Manage Search Engines" dialog,
imdb.com was at the bottom of the list. Double-click it, set the keyword to "imdb" and go back to the browser. Now when I type "imdb" in the address bar, the first auto-complete entry is to search
imdb.com. The browser asks to "type Tab to search
imdb.com", but I just hit space anyway like I do in Firefox and it works.
The this keyword refers to the context where a piece of code, such as a function's body, is supposed to run. Most typically, it is used in object methods, where this refers to the object that the method is attached to, thus allowing the same method to be reused on different objects.
The value of this in JavaScript depends on how a function is invoked (runtime binding), not how it is defined. When a regular function is invoked as a method of an object (obj.method()), this points to that object. When invoked as a standalone function (not attached to an object: func()), this typically refers to the global object (in non-strict mode) or undefined (in strict mode). The Function.prototype.bind() method can create a function whose this binding doesn't change, and methods Function.prototype.apply() and Function.prototype.call() can also set the this value for a particular call.
Arrow functions differ in their handling of this: they inherit this from the parent scope at the time they are defined. This behavior makes arrow functions particularly useful for callbacks and preserving context. However, arrow functions do not have their own this binding. Therefore, their this value cannot be set by bind(), apply() or call() methods, nor does it point to the current object in object methods.
For a regular function (not an arrow function, bound function, etc.), the value of this is the object that the function is accessed on. In other words, if the function call is in the form obj.f(), then this refers to obj. For example:
The value of this is not the object that has the function as an own property, but the object that is used to call the function. You can prove this by calling a method of an object up in the prototype chain.
In typical function calls, this is implicitly passed like a parameter through the function's prefix (the part before the dot). You can also explicitly set the value of this using the Function.prototype.call(), Function.prototype.apply(), or Reflect.apply() methods. Using Function.prototype.bind(), you can create a new function with a specific value of this that doesn't change regardless of how the function is called. When using these methods, the this substitution rules above still apply if the function is non-strict.
Occasionally, a callback is called with a this value other than undefined. For example, the reviver parameter of JSON.parse() and the replacer parameter of JSON.stringify() are both called with this set to the object that the property being parsed/serialized belongs to.
In the second example (C2), because an object was returned during construction, the new object that this was bound to gets discarded. (This essentially makes the statement this.a = 37; dead code. It's not exactly dead because it gets executed, but it can be eliminated with no outside effects.)
A class can be split into two contexts: static and instance. Constructors, methods, and instance field initializers (public or private) belong to the instance context. Static methods, static field initializers, and static initialization blocks belong to the static context. The this value is different in each context.
Static methods are not properties of this. They are properties of the class itself. Therefore, they are generally accessed on the class, and this is the value of the class (or a subclass). Static initialization blocks are also evaluated with this set to the current class.
Field initializers are also evaluated in the context of the class. Instance fields are evaluated with this set to the instance being constructed. Static fields are evaluated with this set to the current class. This is why arrow functions in field initializers are bound to the instance for instance fields and to the class for static fields.
Unlike base class constructors, derived constructors have no initial this binding. Calling super() creates a this binding within the constructor and essentially has the effect of evaluating the following line of code, where Base is the base class:
In the global execution context (outside of any functions or classes; may be inside blocks or arrow functions defined in the global scope), the this value depends on what execution context the script runs in. Like callbacks, the this value is determined by the runtime environment (the caller).
Note that some source code, while looking like the global scope, is actually wrapped in a function when executed. For example, Node.js CommonJS modules are wrapped in a function and executed with the this value set to module.exports. Event handler attributes are executed with this set to the element they are attached to.
Calling f.bind(someObject) creates a new function with the same body and scope as f, but the value of this is permanently bound to the first argument of bind, regardless of how the function is being called.
Arrow functions create closures over the this value of the enclosing execution context. In the following example, we create obj with a method getThisGetter that returns a function that returns the value of this. The returned function is created as an arrow function, so its this is permanently bound to the this of its enclosing function. The value of this inside getThisGetter can be set in the call, which in turn sets the return value of the returned function. We will assume that getThisGetter is a non-strict function, which means it's contained in a non-strict script and not further nested in a class or strict function.
3a8082e126