aboutsummaryrefslogtreecommitdiffstats
path: root/background_scripts
AgeCommit message (Collapse)Author
2017-10-14Allow <c-[> to be mapped as a regular command.Stephen Blott
If map <c-[> someCommand is configured, then the hardwired `<c-[>` meaning `Escape` behaviour is disabled. Users who want to map `<c-[>` probably *never* use it as `Escape`. Fixes #2722.
2017-09-30Merge branch 'curipha-search-compl-amazon-co-jp'Stephen Blott
2017-09-30Use Japan instead of Jp.Stephen Blott
2017-09-30Merge pull request #2665 from curipha/search-compl-google-co-jpStephen Blott
Search completion; add support for Google.co.jp completion
2017-09-30Merge pull request #2683 from mrmr1993/inject-css-for-framesStephen Blott
Inject user css into all frames
2017-09-29Inject custom user styles into all framesmrmr1993
This fixes #2594.
2017-09-29Use openerTabId in chrome.tabs.create when possiblemrmr1993
2017-09-23Search completion; add support for Google.co.jp completionTaichi
2017-09-23Search completion; add support for Amazon.co.jp completionTaichi
2017-09-21Add openUrlInNewWindow commandmrmr1993
2017-09-21FF: Simulate default action for clicking links with link hintsmrmr1993
2017-09-12Use browser.runtime.getBrowserInfo to identify Firefoxmrmr1993
2017-09-12Add Utils.isFirefoxmrmr1993
This also stops the content scripts from being injected into each frame on reload (in Firefox only). They do not successfully connect to the background page, and it causes considerable lag, so we lose nothing by doing this.
2017-08-31Update URLs to HTTPS in code, pages and docsDavid Beitey
Updating URLs to use HTTPS provides greater privacy and reduces the potential of having content modified whilst in transit (as it happening more and more by ISPs, networks, state actors etc). These URLs themselves have been tested and confirmed to work over HTTPS.
2017-08-15Fix search completion (Firefox).Stephen Blott
The problem is that Firefox balks at function properties within the response sent via `postMessage` (whereas Chrome does not). A concise and safe way to sanitize the response is to convert it to JSON and back. Fixes #2576.
2017-05-01FF - Fix updates from the exclusions popupmrmr1993
This stops |Exclusions| from holding a reference to the |value| parameter passed to |Settings.set|. In Firefox, this object is garbage collected when the owning context (the exclusions popup) is closed. The fix for all such cases in the future is to switch to using |Settings.get|, which implicitly does |JSON.parse JSON.stringify value| and thus returns an object in the same context as |Settings|. We could fix this generally by doing this for the |Settings.performPostUpdateHook| call in |Settings.set| instead. However, I'm not convinced that it warrants the overhead of a |JSON.parse| for every |Settings.set| call.
2017-04-21Firefox: Fix createTab.Stephen Blott
Firefox baulks at "about:newtab" in createTab (but seems happy with no URL specified). Chrome is also happy with no URL specified. (Does this mean that we don't need "about:newtab" ANYWHERE in the code base? Could Settings.defaults.newTabUrl just be ""?) Mention @mrmr1993.
2017-04-20Firefox: some history entries have no title.Stephen Blott
This causes `o`/`O` to crash (producing no suggestions). As a workaround, set any such title to "".
2017-04-18Merge pull request #2476 from mrmr1993/firefoxStephen Blott
Improve firefox support
2017-04-17Regenerate help page data when key bindings are updatedmrmr1993
2017-04-16Workaround type error for unsupported openerTabId in FFmrmr1993
2017-04-16Fallback to storage.local if storage.sync is not availablemrmr1993
2017-02-08Stop using deprecated key 'selected' of tabs; switch to 'active'mrmr1993
The documentation suggests that 'highlighted' is equivalent to 'selected'. However, multiple tabs can be highlighted in a window -- in fact, everywhere 'selected' was used, we wanted the unique active tab.
2017-02-08Stop using deprecated tabs.getAllInWindow; switch to tabs.querymrmr1993
2017-02-08Stop using deprecated tabs.getSelected; switch to tabs.querymrmr1993
2016-12-11Better wording fo command description.Stephen Blott
2016-12-11Documentation for updates.Stephen Blott
2016-12-11Use registryEntry.optionList.Stephen Blott
This means that we get the new tabs in the same order as they are specified in the key mapping.
2016-12-11Extend createTab to open specific pages.Stephen Blott
Example: map a createTab http://edition.cnn.com/ http://www.bbc.co.uk/news which creates two new tabs, but preloaded with these specific URLs. `2a` creates four new tabs, two copies of each. Limitation: - We cannot control the order of the tabs, so we might get CNN then BBC, or BBC then CNN. This happens because command options are stored in an object, and we cannot control the order of the keys. Also, with: map a createTab http://www.bbc.co.uk/news http://www.bbc.co.uk/news we only get one new tab (same reason as above).
2016-12-11Add the raw option list to the command registry.Stephen Blott
Keep the option list (in addition to the parsed command options) because some commands may depend upon the command option order. One currect example is #2318.
2016-12-11Ensure that we get the last for a key.Stephen Blott
(Because we're scanning backwards throught the mappings, we shouldn't overwrite an existing mapping.)
2016-12-11Remove Utils.nextTick() to fix tests.Stephen Blott
2016-12-11Rework help-dialog HTML.Stephen Blott
Previously, the dynamic HTML for the help dialog was generated on the background page. The HTML itself was tangled in with program logic. Here, we move all of the HTML to HTML5 templates; also, we build the help-dialog contents in the help dialog itself, not on the background page. Note: #2368 is included here too. (Background: I'm trying to clean up some of the command and help-dialog logic in preparation for addressing the issue of how to document command options, see #2319.)
2016-12-11Rework key-mapping parsing.Stephen Blott
There are two changes here: 1. Treat built-in key mappings and custom key mappings in the same way; that is, we prepend the built-in mappings to the custom mappings and then parse them all together. This results in a number of simplifications due to previous duplication of logic and the elimination of special cases. 2. Parse key mappings in reverse order, so we can just ignore key mappings after first encountering a key sequence. So, `map`, `unmap` and `unmapAll` are all treated in more or less the same way. This is preparatory to reworking some aspects of the help page. In particular, regardless of the order of maps, unmaps, etc., this approach makes it easier to find the mapping in effect for a key sequence (and be able to recreate the order of those mappings).
2016-10-23Move SearchEngines to bg-utils.coffee.Stephen Blott
`SearchEngines` was previously in `utils.coffee`, which means it was loaded in *every* content frame. This is unnecessary, since it is only used on the background page. So this PR moves it there. Also: - Simplify some unnecessarily complex logic in `vomnibar.coffee`. - Re-use `Utils.parseLines()` to parse the custom search engine configuation text.
2016-10-23Better line parsing (simplified).Stephen Blott
2016-10-17Better line parsing.Stephen Blott
1. Explicitly remove comments. 2. A trailing backslash means the current line continues on the next line. E.g. a \ b \ c is a single line `a b c`. This helps alleviate the fact that configuration lines can be very long, whereas the *Custom key mappings* input is quite narrow. TODO: We should use the same line parser in the custom-search-engines input.
2016-10-10Rename 'translate' to 'mapkey'.Stephen Blott
2016-10-09Add translate command for key mappings.Stephen Blott
Under *Custom key mappings* (on the options page), this implements: translate x y Whenever the users types `x` in normal mode or in visual mode, the `x` is replaced by `y`. For example: map รง l (which apparently would be helpful on Brazilian keyboards). Issues: - Do we want yet another hack like this? This would be documented only on the wiki. - If we allowed `translate <c-c> <c-[>` (and extended `isEscape()` to use the translation), then we'd get the `exitMode` command for free (#2253). - Alternatively, instead of adding a new "command" called `translate`, we could overload the existing `map` command. Since these are single-key mappings, there's no ambiguity. (Although, I guess there's a risk some user has junk in their key mappings and would be taken by surprise). Inspired by isssue posted by @vhoyer (#2305). Fixes #2305.
2016-10-09Move logging to the frame's port.Stephen Blott
Comminication by the frame's port is faster, and no response is sent.
2016-10-09Remove description from registry entry for key-state mapping.Stephen Blott
We do not need the registryEntry's decription in the content scripts, so remove it (saving a marginal amount of memory and time).
2016-10-08Refactor (and fix) key-parsing regexp.Stephen Blott
Fixes #2299. Also, separate this regexp out into its constituent parts, because it is becoming too different to read.
2016-10-02Tweak logging.Stephen Blott
2016-10-02Merge pull request #2284 from smblott-github/silent-releasesStephen Blott
Enable silent/patch releases.
2016-10-02Better regexp (to match legacy behaviour for '<c->>'.Stephen Blott
2016-10-02Single quotes are clearer here.Stephen Blott
2016-10-02Rename normalizeKey to parseKeySequence.Stephen Blott
The new name better describes which the function does.
2016-10-02Add comment giving example key parsing.Stephen Blott
2016-10-02Rework key-sequence parsing.Stephen Blott
This reworks the parsing of key sequences like `<c-a-Z>x`: Advantages over the status quo: - Parses key sequences in one only place (previously two), - Removes two hideous regular expression. - Admits multi-modifier bindings (like `<c-a-Z>`). - Adds more (and better) tests. - (And it should be easier to maintain.) Replaces #2210 (this also simplifies key parsing substantially).
2016-10-01Enable silent/patch releases.Stephen Blott
Currently, all new releases trigger a notification. This changes that behaviour such that if the previous and current releases have the same major and minor release numbers, then no notification is shown. This allows us to push bug-fix and minor releases without bugging the user.