-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSEDEPermalink.user.js
More file actions
33 lines (30 loc) · 1021 Bytes
/
SEDEPermalink.user.js
File metadata and controls
33 lines (30 loc) · 1021 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// ==UserScript==
// @name SEDE Parameterized Query Permalink
// @namespace https://stackexchange.com/users/305991/jason-c
// @version 1.0
// @description Adds ability to get permalinks for parameterized queries.
// @author Jason C
// @match *://data.stackexchange.com/*/query/*
// @exclude *://data.stackexchange.com/*/query/edit*
// @exclude *://data.stackexchange.com/*/query/new*
// @grant none
// ==/UserScript==
(function() {
'use strict';
$('<button type="button"/>')
.addClass('btn-normal')
.text('Get Link')
.click(function () {
var link = [
window.location.protocol,
'//',
window.location.host,
window.location.pathname,
'?',
$('#runQueryForm').serialize(),
window.location.hash
].join('');
window.prompt('Permalink:', link);
})
.insertAfter('#cancel-query');
})();