-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Romain Ricard
committed
Feb 6, 2021
0 parents
commit 3520ab9
Showing
5 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
This quick and dirty Firefox/Chrome extension adds a "Preview" button on `signal.art`, that | ||
allows to open a pack on `signalstickers.com` for easier preview. | ||
|
||
|
||
![](.github/screenshot.png) | ||
|
||
|
||
|
||
## Install of Firefox | ||
|
||
Go to URL `about:config`, search for `xpinstall.signatures.required` and double-click on the value to set it to `false`. | ||
|
||
Then, in `about:addons`, click on the wheel, select "Install add-on from file", and select `signal.art_preview-[version].zip`. | ||
|
||
## Install on Chrome | ||
|
||
Go to URL `chrome://extensions/`, enable Developper mode, then load this folder. | ||
|
||
|
||
## Build | ||
|
||
> A packaged version is available in the `web-ext-artifacts' directory. | ||
Install [Firefox's tool Web-ext](https://developer.mozilla.org/fr/docs/Mozilla/Add-ons/WebExtensions/Getting_started_with_web-ext). | ||
Then, do `web-ext build`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"description": "Add a 'Preview on signalstickers.com' button on signal.art page", | ||
"manifest_version": 2, | ||
"name": "signal.art preview", | ||
"version": "1.1", | ||
"content_scripts": [ | ||
{ | ||
"matches": [ | ||
"https://signal.art/addstickers/*" | ||
], | ||
"js": [ | ||
"signalstickerpreview.js" | ||
] | ||
} | ||
], | ||
"browser_specific_settings": { | ||
"gecko": { | ||
"id": "[email protected]", | ||
"strict_min_version": "42.0" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
function parseParameters(hash) { | ||
var params = {}; | ||
|
||
hash.split("&").forEach(function (item) { | ||
var parts = item.split("="); | ||
if (parts.length == 2) { | ||
params[parts[0]] = parts[1]; | ||
} | ||
}); | ||
|
||
return params; | ||
} | ||
|
||
|
||
let container = document.getElementById("add-stickers-button"); | ||
|
||
let previewButton = document.createElement('button'); | ||
previewButton.className = "button button-large"; | ||
previewButton.style.margin = "0 auto 20px auto"; | ||
previewButton.style.display = "block"; | ||
|
||
let previewLink = document.createElement("a") | ||
|
||
let params = parseParameters(window.location.hash.substr(1)); | ||
previewLink.href = `https://signalstickers.com/pack/${params.pack_id}?key=${params.pack_key}`; | ||
previewLink.target = "_blank"; | ||
previewLink.className = "no-underline"; | ||
previewLink.innerText = "PREVIEW on signalstickers.com"; | ||
|
||
previewButton.appendChild(previewLink) | ||
container.appendChild(previewButton); |
Binary file not shown.