Skip to content

Commit

Permalink
Merge pull request #2 from Strappazzon/master
Browse files Browse the repository at this point in the history
Improvements
  • Loading branch information
shinrax2 authored Jun 5, 2019
2 parents 1886191 + 5fbd7ee commit db738d2
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 52 deletions.
55 changes: 27 additions & 28 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,34 @@
{
"manifest_version":2,
"name":"__MSG_extensionName__",
"version":"1.2",
"author":"shinrax2",
"description":"__MSG_extensionDescription__",
"default_locale": "en",

"content_scripts":[
{
"exclude_matches":[
"*://help.steampowered.com/*",
"*://steamcommunity.com/openid/login*"
],
"matches":[
"*://*.steamcommunity.com/*",
"*://*.steampowered.com/*"
],
"js":[
"manifest_version": 2,
"name": "__MSG_extensionName__",
"version": "1.2",
"author": "shinrax2",
"description": "__MSG_extensionDescription__",
"default_locale": "en",

"content_scripts": [{
"exclude_matches": [
"*://steamcommunity.com/login*",
"*://steamcommunity.com/openid/login*",
"*://help.steampowered.com/*/wizard/Login*",
"*://*.steampowered.com/login*",
"*://store.steampowered.com/about*"
],
"matches": [
"*://steamcommunity.com/*",
"*://*.steampowered.com/*"
],
"js": [
"openinsteam.js"
]
}
],

"icons" : {
"48" : "icons/48x48.png",
"96" : "icons/96x96.png"
]
}],
"icons" : {
"48" : "icons/48x48.png",
"96" : "icons/96x96.png"
},

"applications": {
"applications": {
"gecko": {
"id": "openinsteampublic@shinrax2"
}
}
}
}
42 changes: 18 additions & 24 deletions openinsteam.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,20 @@
'use strict';

if(!browser) {
var browser = chrome // to support chrome
var browser = chrome // to support chrome
}

let str = browser.i18n.getMessage("steamButtonText")
let ustr = str.toUpperCase();
let url = "steam://openurl/" + encodeURI(window.location)

const instbtn = document.getElementsByClassName('header_installsteam_btn header_installsteam_btn_green')[0].parentNode;
instbtn.insertAdjacentHTML('afterbegin', '<div class="header_installsteam_btn header_installsteam_btn_green"><a style="background-color: #397198 !important; background-image: url(\'https://steamcdn-a.akamaihd.net/store/about/icon-steamos.svg\') !important; background-size: 13px" class="header_installsteam_btn_content" href="' + url + '">' + str + '</a></div>');

if (document.querySelector("#footer_nav")) {
const footer_nav = document.querySelector('#footer_steam_pulldown').parentNode;
footer_nav.insertAdjacentHTML('afterbegin', '<a id="footer_steam_pulldown" class="pulldown btnv6_blue_hoverfade btn_small" href="' + url + '"><span>' + ustr + '</span></a>');
} else {
const valve_links = document.getElementsByClassName('valve_links')[0];
valve_links.insertAdjacentHTML('beforeend', '<a style="padding-left: 10px;"></a> | <a style="padding-left: 10px;" href="' + url + '">' + str + '</a>');
}
var btntxt = browser.i18n.getMessage("steamButtonText")
var e = document.getElementsByClassName("logo")[0]
var f = document.getElementsByClassName("footer_content")[0]
var a = document.createElement("a")
var ref = document.createAttribute("href")
ref.value = "steam://openurl/"+encodeURI(window.location)
var btn = document.createElement("button")
var t = document.createTextNode(btntxt)
btn.append(t)
a.setAttributeNode(ref)
a.append(btn)
e.append(a)
var span = document.createElement("span")
var ab = document.createElement("a")
var refb = document.createAttribute("href")
refb.value = "steam://openurl/"+encodeURI(window.location)
var btnb = document.createElement("button")
var tb = document.createTextNode(btntxt)
btnb.append(tb)
ab.setAttributeNode(refb)
ab.append(btnb)
span.append(ab)
f.append(span)

0 comments on commit db738d2

Please sign in to comment.