aboutsummaryrefslogtreecommitdiffstats
path: root/lib/utils.coffee
AgeCommit message (Collapse)Author
2018-09-14fix logic for appending %s to searchUrlRyan Perry-Nguyen
2018-09-14dont queries for %S replacementRyan Perry-Nguyen
2017-10-28Remove invokeCommandString, call NormalModeCommands directlymrmr1993
2017-10-25FF: Share |root| global proxy, re-add the globals to window on DOMLoadmrmr1993
This is a workaround for Firefox bug 1408996.
2017-09-29Use openerTabId in chrome.tabs.create when possiblemrmr1993
2017-09-18Recognise (FF) internal URLs.Stephen Blott
Recognise URLs like: - moz-extension://c66906b4-3785-4a60-97bc-094a6366017e/pages/options.html Fixes #2657.
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-18Check whether events are trusted before executing listenersmrmr1993
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-09Extend key translation to include Escape.Stephen Blott
Here, these map to escape: translate x <c-[> translate <c-c> <c-[>
2016-03-27Remove longestCommonPrefix(); not being used.Stephen Blott
2016-03-27Remove copyObjectOmittingProperties(); not being used.Stephen Blott
2016-03-27Add test for invokeCommandString().Stephen Blott
2016-03-26Multiple minor tweaks.Stephen Blott
Some of this code is showing its age, so these are just a number of minor tweaks (to keep things clear, consistent and concise). Also, add a couple of tests (while we're at it).
2016-03-26Merge branch 'standardise-foreground-commands'Stephen Blott
Conflicts: content_scripts/vimium_frontend.coffee
2016-03-26Simplify invokeCommandString().Stephen Blott
There's no need to have the previous unusual calling style (passing the arguments as a list. It looks more natural to pass tham just as regular arguments, as here.
2016-03-21Simplify singleton handling.Stephen Blott
While working on the visual-mode code, it became apparent that our current "singleton" implementation is unnecessarily complicated. This simplifies it. The keys are now required to be strings. (Previously, they could be any object; which meant we needed to gove objects an identity. All of which was complicated.)
2016-03-18Add Utils.makeIdempotent.Stephen Blott
The intention is to use this to clean up some of the initialisation sequences in the front end.
2016-02-16Use `for own ... of` instead of `for ... of`mrmr1993
2016-02-11Tidy up detection for the current page and context belonging to usmrmr1993
2016-02-03Move help dialog into an iframemrmr1993
2016-01-28Simplify hint-string generation; simplification.Stephen Blott
2015-09-20Merge pull request #1086 from mrmr1993/countMatchesPhil Crosby
Rework to make match counting code for searches more DRY and easier to read
2015-09-11Tweak comment from #1813.Stephen Blott
2015-09-11Move escaping regex special chars to its own utility functionmrmr1993
2015-09-10Don't decode javascript URIs on 46.0.2467.2 and latermrmr1993
The fix for Chromium issue 483000 landed in this version, so it is no longer necessary for #1611
2015-08-28fix a bug that Utils using DomUtilsgdh1995
remove Utils.createElementFromHtml since it's not in use
2015-08-26Use createElementNS for XML documents and remove XML specific codepathsmrmr1993
This implements @gdh1995's idea from #1796.
2015-06-20The second part of b09822eb349ec88a573d4f450e9b57e8fa3c6473 is incorrect.Stephen Blott
Revert it.
2015-06-20Fix SimpleCache bugs.Stephen Blott
This fixes two bugs in SimpleCache. 1. Rotate the cache on the next tick. There is a marginally small chance that the cache will rotate between calls to .has() and .get(). So, we do the rotation ansynchronously. This guarantees that these two functions will always see the same cache state. 2. The implementation of .clear() (which is unused, I think) has at some point become out of date (and incorrect) w.r.t. the implementation of .rotate().
2015-05-31Merge pull request #1697 from smblott-github/vomnibar-map-with-prepopulated-textStephen Blott
Direct keyboard access to custom-search engines via keyword flag
2015-05-29Verify keyword for custom search-engine activation.Stephen Blott
For ... map s Vomnibar.activate keyword=g ... we verify that "g" is indeed a custom search-engine keyword before setting it. If it is not, we output a console.log message and launch a vanilla vomnibar. (An alternative would be to bail.)
2015-05-29Move search-engine parsing to Utils.Stephen Blott
This will allow us to use the same search-engine parsing code in the background page and in content scripts.
2015-05-29Only perform settings migration in the background pagemrmr1993
2015-05-18Merge branch 'vomnibar-insert-history-with-tab'Stephen Blott
Conflicts: background_scripts/completion.coffee
2015-05-17use a less brittle approach to decoding URIs.Stephen Blott
2015-05-17TabToOpen: respect trailing options when extracting query terms.Stephen Blott
A custom search engine like this... i: https://www.google.ie/search?q=%s&num=30&newwindow=1&biw=1918&bih=1015&tbm=isch Google image search Should not match a URL like this... https://www.google.ie/search?q=bbc+sport
2015-05-17TabToOpen: more tidy up pre-PR.Stephen Blott
2015-05-17TabToOpen: tidy up pre-PR.Stephen Blott
2015-05-16Refactor query extraction to Utils.extractQuery().Stephen Blott
If we go with this and #1662, then we can share the utility.
2015-05-14Rework how SimpleCache works.Stephen Blott
Change the implementation of SimpleCache such that it does not rely upon timers. The problem with times is that they retain a reference to the object even if Vimium itself loses all references. This approach seems simpler, and perfectly adequate for our purposes.
2015-05-11Merge branch 'search-engine-completion-v5'Stephen Blott
2015-05-10Search completion; fix synchronisation issue.Stephen Blott
2015-05-10Search completion; reuse previous query.Stephen Blott
2015-05-10Search completion; refactor job-running logic.Stephen Blott
2015-05-10Search completion; rework SimpleCache.Stephen Blott
2015-05-10Search completion; refactor searchEngineCompleter.Stephen Blott
This revamps how search-engine configuration is handled, and revises some rather strange legacy code.
2015-05-09Search completion; refactor SearchCompleter activation.Stephen Blott
2015-05-08Search completion; search keyword on SPACE.Stephen Blott