Skip to content

Instantly share code, notes, and snippets.

@markusdosch
Created August 5, 2020 08:09
Show Gist options
  • Save markusdosch/a702552b072df742d5672f2156449d09 to your computer and use it in GitHub Desktop.
Save markusdosch/a702552b072df742d5672f2156449d09 to your computer and use it in GitHub Desktop.
Refined Confluence: Automatically select the search filter to search in current Confluence space
// ==UserScript==
// @name refined-confluence
// @namespace https://markusdosch.com/
// @version 0.1
// @description Refined Confluence: Automatically select the search filter to search in current Confluence space
// @author Markus Dosch
// @match https://confluence.*.de/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
document.querySelector("#quick-search-query").addEventListener("focus", () => {
window.setTimeout(() => {
document.querySelector("#content-space-search-filter-button").click();
document.querySelector("#content-space-filter-checkbox-list label").click();
document.querySelector("#search-filter-input").focus();
}, 500);
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment