From 0484556eb7b1227b911a302d06b2d0b41653ff5d Mon Sep 17 00:00:00 2001 From: Jon McLaren Date: Thu, 31 Jan 2019 12:45:45 -0600 Subject: [PATCH 01/47] Added Chrome Inspector panel for extension. So freakin' cool. --- devtools.html | 6 ++++++ devtools.js | 5 +++++ manifest.json | 1 + panel.html | 1 + 4 files changed, 13 insertions(+) create mode 100644 devtools.html create mode 100644 devtools.js create mode 100644 panel.html diff --git a/devtools.html b/devtools.html new file mode 100644 index 0000000..bfe734e --- /dev/null +++ b/devtools.html @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/devtools.js b/devtools.js new file mode 100644 index 0000000..25fd6ce --- /dev/null +++ b/devtools.js @@ -0,0 +1,5 @@ +var knockoutPanel = chrome.devtools.panels.create( + "HubSpot", + "icon-16.png", + "/panel.html" +); \ No newline at end of file diff --git a/manifest.json b/manifest.json index c064e4f..b6233f4 100644 --- a/manifest.json +++ b/manifest.json @@ -47,6 +47,7 @@ "persistent": true, "scripts": ["hot-reload.js", "background.js"] }, + "devtools_page": "devtools.html", "commands": { "bust-cache": { "suggested_key": { diff --git a/panel.html b/panel.html new file mode 100644 index 0000000..a9c4930 --- /dev/null +++ b/panel.html @@ -0,0 +1 @@ +

omfg it works

\ No newline at end of file From df47ba7e779775469cff62ece4f530c59851e977 Mon Sep 17 00:00:00 2001 From: Jon McLaren Date: Thu, 31 Jan 2019 19:58:22 -0600 Subject: [PATCH 02/47] created content script, created dev panel --- background.js | 17 +++++++++++++++++ devtools.html | 4 +++- devtools.js | 24 ++++++++++++++++++++++-- hsInspector.js | 1 + manifest.json | 6 ++++-- panel.html | 14 +++++++++++++- panel.js | 16 ++++++++++++++++ 7 files changed, 76 insertions(+), 6 deletions(-) create mode 100644 hsInspector.js create mode 100644 panel.js diff --git a/background.js b/background.js index ec045b2..f96b215 100644 --- a/background.js +++ b/background.js @@ -31,7 +31,24 @@ chrome.runtime.onMessage.addListener( trackClick(request.trackClick); sendResponse({ farewell: "Tracked!" }); } + } +); + +chrome.runtime.onConnect.addListener(function(devToolsConnection) { + // assign the listener function to a variable so we can remove it later + var devToolsListener = function(message, sender, sendResponse) { + // Inject a content script into the identified tab + console.log("script:",message.scriptToInject); + chrome.tabs.executeScript(message.tabId, + { file: message.scriptToInject }); + } + // add the listener + devToolsConnection.onMessage.addListener(devToolsListener); + + devToolsConnection.onDisconnect.addListener(function() { + devToolsConnection.onMessage.removeListener(devToolsListener); }); +}); diff --git a/devtools.html b/devtools.html index bfe734e..e9862da 100644 --- a/devtools.html +++ b/devtools.html @@ -1,6 +1,8 @@ - + + + \ No newline at end of file diff --git a/devtools.js b/devtools.js index 25fd6ce..101ab12 100644 --- a/devtools.js +++ b/devtools.js @@ -1,5 +1,25 @@ -var knockoutPanel = chrome.devtools.panels.create( +var Panel = chrome.devtools.panels.create( "HubSpot", "icon-16.png", "/panel.html" -); \ No newline at end of file +); + +var backgroundPageConnection = chrome.runtime.connect({ + name: "devtools-page" +}); + +backgroundPageConnection.onMessage.addListener(function (message) { + // Handle responses from the background page, if any +}); + +console.log("devtools.js ran"); + + + + +/* +// Relay the tab ID to the background page +chrome.runtime.sendMessage({ + tabId: chrome.devtools.inspectedWindow.tabId, + scriptToInject: "hsInspector.js" +});*/ \ No newline at end of file diff --git a/hsInspector.js b/hsInspector.js new file mode 100644 index 0000000..e30ede9 --- /dev/null +++ b/hsInspector.js @@ -0,0 +1 @@ +console.log("hsinspector js loaded!"); \ No newline at end of file diff --git a/manifest.json b/manifest.json index b6233f4..04c795f 100644 --- a/manifest.json +++ b/manifest.json @@ -28,7 +28,9 @@ ], "optional_permissions": [ "https://app.hubspot.com/*", - "https://app.hubspotqa.com/*" + "https://app.hubspotqa.com/*", + "tabs", + "" ], "web_accessible_resources": [ "mac-text-cursor.svg", @@ -36,7 +38,7 @@ ], "content_scripts": [{ "run_at": "document_idle", - "js": ["jquery-3.2.1.min.js", "design-manager.js"], + "js": ["jquery-3.2.1.min.js", "design-manager.js","hsInspector.js"], "css": ["hsDarkIde.css"], "document_idle": "document_start", "matches": ["https://app.hubspot.com/*", "https://app.hubspotqa.com/*"] diff --git a/panel.html b/panel.html index a9c4930..9ae2bd3 100644 --- a/panel.html +++ b/panel.html @@ -1 +1,13 @@ -

omfg it works

\ No newline at end of file + + + + + + +

omfg it works

+ + + + + + diff --git a/panel.js b/panel.js new file mode 100644 index 0000000..5a9e8ae --- /dev/null +++ b/panel.js @@ -0,0 +1,16 @@ +console.log("paneljs loaded"); +document.querySelector('#load').addEventListener('click', function(event) { + // Permissions must be requested from inside a user gesture, like a button's + // click handler. + chrome.permissions.request({ + permissions: ['tabs'], + origin:[''] + }, function(granted) { + // The callback argument will be true if the user granted the permissions. + if (granted) { + console.log("Perm granted"); + } else { + console.log("Perm denied"); + } + }); + }); From 3f6494d1b6a8d98dc96c88bf7f77bcfd754af104 Mon Sep 17 00:00:00 2001 From: Jon McLaren Date: Thu, 31 Jan 2019 20:52:07 -0600 Subject: [PATCH 03/47] checking permissions and sending message --- devtools.js | 33 ++++++++++++++++++++++----------- panel.js | 8 +++++++- 2 files changed, 29 insertions(+), 12 deletions(-) diff --git a/devtools.js b/devtools.js index 101ab12..e6c5b13 100644 --- a/devtools.js +++ b/devtools.js @@ -1,15 +1,15 @@ var Panel = chrome.devtools.panels.create( - "HubSpot", - "icon-16.png", - "/panel.html" +"HubSpot", +"icon-16.png", +"/panel.html" ); var backgroundPageConnection = chrome.runtime.connect({ - name: "devtools-page" +name: "devtools-page" }); backgroundPageConnection.onMessage.addListener(function (message) { - // Handle responses from the background page, if any +// Handle responses from the background page, if any }); console.log("devtools.js ran"); @@ -17,9 +17,20 @@ console.log("devtools.js ran"); -/* -// Relay the tab ID to the background page -chrome.runtime.sendMessage({ - tabId: chrome.devtools.inspectedWindow.tabId, - scriptToInject: "hsInspector.js" -});*/ \ No newline at end of file +chrome.permissions.contains({ + permissions: ['tabs'], + origins: [''] + }, function(result) { + if (result) { + // The extension has the permissions. + // Relay the tab ID to the background page + chrome.runtime.sendMessage({ + tabId: chrome.devtools.inspectedWindow.tabId, + scriptToInject: "hsInspector.js" + }); + } else { + // The extension doesn't have the permissions. + + } +}); + diff --git a/panel.js b/panel.js index 5a9e8ae..77750b1 100644 --- a/panel.js +++ b/panel.js @@ -4,11 +4,17 @@ document.querySelector('#load').addEventListener('click', function(event) { // click handler. chrome.permissions.request({ permissions: ['tabs'], - origin:[''] + origins:[''] }, function(granted) { // The callback argument will be true if the user granted the permissions. if (granted) { console.log("Perm granted"); + + // Relay the tab ID to the background page + chrome.runtime.sendMessage({ + tabId: chrome.devtools.inspectedWindow.tabId, + scriptToInject: "hsInspector.js" + }); } else { console.log("Perm denied"); } From c23b8cad6f1787264bb3e8b3673c594a7db5fe7e Mon Sep 17 00:00:00 2001 From: Jon McLaren Date: Fri, 1 Feb 2019 08:14:33 -0600 Subject: [PATCH 04/47] updated permissions. --- background.js | 3 ++- manifest.json | 2 +- panel.js | 6 +----- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/background.js b/background.js index f96b215..e613ca1 100644 --- a/background.js +++ b/background.js @@ -34,6 +34,7 @@ chrome.runtime.onMessage.addListener( } ); +/* chrome.runtime.onConnect.addListener(function(devToolsConnection) { // assign the listener function to a variable so we can remove it later var devToolsListener = function(message, sender, sendResponse) { @@ -49,7 +50,7 @@ chrome.runtime.onConnect.addListener(function(devToolsConnection) { devToolsConnection.onMessage.removeListener(devToolsListener); }); }); - +*/ chrome.commands.onCommand.addListener(function(command) { diff --git a/manifest.json b/manifest.json index 04c795f..e50f21f 100644 --- a/manifest.json +++ b/manifest.json @@ -38,7 +38,7 @@ ], "content_scripts": [{ "run_at": "document_idle", - "js": ["jquery-3.2.1.min.js", "design-manager.js","hsInspector.js"], + "js": ["jquery-3.2.1.min.js", "design-manager.js"], "css": ["hsDarkIde.css"], "document_idle": "document_start", "matches": ["https://app.hubspot.com/*", "https://app.hubspotqa.com/*"] diff --git a/panel.js b/panel.js index 77750b1..050c7e9 100644 --- a/panel.js +++ b/panel.js @@ -10,11 +10,7 @@ document.querySelector('#load').addEventListener('click', function(event) { if (granted) { console.log("Perm granted"); - // Relay the tab ID to the background page - chrome.runtime.sendMessage({ - tabId: chrome.devtools.inspectedWindow.tabId, - scriptToInject: "hsInspector.js" - }); + } else { console.log("Perm denied"); } From 66ee912d56b88be052182a91257af28a4e356558 Mon Sep 17 00:00:00 2001 From: Jon McLaren Date: Fri, 1 Feb 2019 11:48:22 -0600 Subject: [PATCH 05/47] uncommented communication script for bg js and added inspectorjs back into manifest --- background.js | 4 ++-- manifest.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/background.js b/background.js index e613ca1..005184c 100644 --- a/background.js +++ b/background.js @@ -34,7 +34,7 @@ chrome.runtime.onMessage.addListener( } ); -/* + chrome.runtime.onConnect.addListener(function(devToolsConnection) { // assign the listener function to a variable so we can remove it later var devToolsListener = function(message, sender, sendResponse) { @@ -50,7 +50,7 @@ chrome.runtime.onConnect.addListener(function(devToolsConnection) { devToolsConnection.onMessage.removeListener(devToolsListener); }); }); -*/ + chrome.commands.onCommand.addListener(function(command) { diff --git a/manifest.json b/manifest.json index e50f21f..04c795f 100644 --- a/manifest.json +++ b/manifest.json @@ -38,7 +38,7 @@ ], "content_scripts": [{ "run_at": "document_idle", - "js": ["jquery-3.2.1.min.js", "design-manager.js"], + "js": ["jquery-3.2.1.min.js", "design-manager.js","hsInspector.js"], "css": ["hsDarkIde.css"], "document_idle": "document_start", "matches": ["https://app.hubspot.com/*", "https://app.hubspotqa.com/*"] From 379a7626e3331761068a970398654ef390dde7b9 Mon Sep 17 00:00:00 2001 From: Jon McLaren Date: Fri, 1 Feb 2019 16:54:37 -0600 Subject: [PATCH 06/47] got the pane to grab the dev info URL and trying to do things --- background.js | 4 +- devtools.js | 7 ++-- hsInspector.js | 27 ++++++++++++- panel.html | 3 +- panel.js | 108 +++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 142 insertions(+), 7 deletions(-) diff --git a/background.js b/background.js index 005184c..e613ca1 100644 --- a/background.js +++ b/background.js @@ -34,7 +34,7 @@ chrome.runtime.onMessage.addListener( } ); - +/* chrome.runtime.onConnect.addListener(function(devToolsConnection) { // assign the listener function to a variable so we can remove it later var devToolsListener = function(message, sender, sendResponse) { @@ -50,7 +50,7 @@ chrome.runtime.onConnect.addListener(function(devToolsConnection) { devToolsConnection.onMessage.removeListener(devToolsListener); }); }); - +*/ chrome.commands.onCommand.addListener(function(command) { diff --git a/devtools.js b/devtools.js index e6c5b13..d12113d 100644 --- a/devtools.js +++ b/devtools.js @@ -3,7 +3,8 @@ var Panel = chrome.devtools.panels.create( "icon-16.png", "/panel.html" ); - +console.log("devtools.js ran"); +/* var backgroundPageConnection = chrome.runtime.connect({ name: "devtools-page" }); @@ -12,7 +13,7 @@ backgroundPageConnection.onMessage.addListener(function (message) { // Handle responses from the background page, if any }); -console.log("devtools.js ran"); + @@ -33,4 +34,4 @@ chrome.permissions.contains({ } }); - +*/ diff --git a/hsInspector.js b/hsInspector.js index e30ede9..c5e94a9 100644 --- a/hsInspector.js +++ b/hsInspector.js @@ -1 +1,26 @@ -console.log("hsinspector js loaded!"); \ No newline at end of file +console.log("hsinspector js loaded!"); + +var devInfoLinks = document.querySelectorAll(".hs-tools-menu a"); + +devInfoLinks.forEach(function(el,i){ + var linkURL = el.getAttribute("href"); + var linkText = el.textContent; + if (linkText.includes("Developer Info")){ + console.log(linkText,linkURL); + chrome.runtime.sendMessage({devInfoURL: linkURL}, function(response) { + console.log(response.farewell); + }); + } + + + +}); + +/* +function ready(fn) { + if (document.attachEvent ? document.readyState === "complete" : document.readyState !== "loading"){ + fn(); + } else { + document.addEventListener('DOMContentLoaded', fn); + } + }*/ \ No newline at end of file diff --git a/panel.html b/panel.html index 9ae2bd3..254f4a3 100644 --- a/panel.html +++ b/panel.html @@ -5,7 +5,8 @@

omfg it works

- + + diff --git a/panel.js b/panel.js index 050c7e9..2d6ba35 100644 --- a/panel.js +++ b/panel.js @@ -1,4 +1,111 @@ console.log("paneljs loaded"); +/* +var test = chrome.devtools.inspectedWindow.eval( + "jQuery.fn.jquery", + function(result, isException) { + if (isException){ + console.log("the page is not using jQuery"); + return false; + } + else{ + console.log("The page is using jQuery v" + result); + + return true; + + } + } +); +console.log("test:",test); +*/ + +function getLink(){ + console.log("woo I made it!"); +} +chrome.tabs.executeScript(chrome.devtools.inspectedWindow.tabId, + { file: "hsInspector.js" }); + +chrome.runtime.onMessage.addListener( + function(request, sender, sendResponse) { + console.log(sender.tab ? + "from a content script:" + sender.tab.url : + "from the extension"); + if (request.devInfoURL){ + sendResponse({farewell: "devInfoURL recieved."}); + $("h1").text(request.devInfoURL); + + $("#dummy").attr('src',request.devInfoURL); + + +/* + function getUrlVars(){ + var vars = [], hash; + var hashes = request.devInfoURL.slice(request.devInfoURL.indexOf('?') + 1).split('&'); + for(var i = 0; i < hashes.length; i++) + { + hash = hashes[i].split('='); + vars.push(hash[0]); + vars[hash[0]] = hash[1]; + } + return vars; + } + console.log(getUrlVars()); + var devInfoData = getUrlVars(); + console.log("PORTAL ID:",devInfoData.portalId) + + + + function getParameterByName(name) { + name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); + var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), + results = regex.exec(location.search); + return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); + } + + var envSuffix = (window.location.hostname.indexOf('qa') !== -1) ? 'qa' : ''; + + var url = devInfoData.url, + portalId = devInfoData.portalId, + loginApiHost = 'login.hubspot' + envSuffix + '.com', + apiHost = 'api.hubapi' + envSuffix + '.com', + parser = document.createElement('a'); + parser.href = url; + $.ajax({ + type: 'POST', + url: 'https://' + loginApiHost + '/login/api-verify', + data: {'portalId':portalId}, + xhrFields: { + withCredentials: true + } + }).done(function(loginData) { + var accessToken = loginData.auth.access_token.token; + $.ajax({ + url: 'https://' + apiHost + '/content/api/v4/domains/by-domain?portalId=' + portalId + '&domain=' + parser.hostname + '&access_token=' + accessToken, + xhrFields: { + withCredentials: true + } + }).done(function(domainData) { + if (domainData.isResolving) { + var redir = parser.protocol + '//' + parser.hostname + '/__context__' + parser.pathname + parser.search; + redir += (redir.indexOf('?') !== -1) ? '&' : '?'; + redir += 'portalId=' + portalId + '&access_token=' + accessToken; + window.location.href = redir; + } + }); + }).fail(function() { + window.location.href = 'https://' + loginApiHost + '/login'; + }); + + + +*/ + + + } + } + +); + +/* document.querySelector('#load').addEventListener('click', function(event) { // Permissions must be requested from inside a user gesture, like a button's // click handler. @@ -16,3 +123,4 @@ document.querySelector('#load').addEventListener('click', function(event) { } }); }); +*/ \ No newline at end of file From 0edfc10749b91042cd99c4c5cbce2fdad71a94e9 Mon Sep 17 00:00:00 2001 From: Jon McLaren Date: Fri, 1 Feb 2019 16:54:48 -0600 Subject: [PATCH 07/47] minor tweaks --- hsInspector.js | 1 + manifest.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/hsInspector.js b/hsInspector.js index c5e94a9..c0c58a2 100644 --- a/hsInspector.js +++ b/hsInspector.js @@ -11,6 +11,7 @@ devInfoLinks.forEach(function(el,i){ console.log(response.farewell); }); } + $("#dummy").attr('src',request.devInfoURL); diff --git a/manifest.json b/manifest.json index 04c795f..e50f21f 100644 --- a/manifest.json +++ b/manifest.json @@ -38,7 +38,7 @@ ], "content_scripts": [{ "run_at": "document_idle", - "js": ["jquery-3.2.1.min.js", "design-manager.js","hsInspector.js"], + "js": ["jquery-3.2.1.min.js", "design-manager.js"], "css": ["hsDarkIde.css"], "document_idle": "document_start", "matches": ["https://app.hubspot.com/*", "https://app.hubspotqa.com/*"] From a9e2be5a03d3c27314be8fa452f044f7b2ec7a4b Mon Sep 17 00:00:00 2001 From: Jon McLaren Date: Mon, 11 Feb 2019 12:56:50 -0600 Subject: [PATCH 08/47] tweaked permissions and added Gonzalo's ajax to see what we can get. --- manifest.json | 3 ++- panel.js | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index e50f21f..34cfa8b 100644 --- a/manifest.json +++ b/manifest.json @@ -29,6 +29,7 @@ "optional_permissions": [ "https://app.hubspot.com/*", "https://app.hubspotqa.com/*", + "tabs", "" ], @@ -41,7 +42,7 @@ "js": ["jquery-3.2.1.min.js", "design-manager.js"], "css": ["hsDarkIde.css"], "document_idle": "document_start", - "matches": ["https://app.hubspot.com/*", "https://app.hubspotqa.com/*"] + "matches": ["https://app.hubspot.com/*", "https://app.hubspotqa.com/*","https://login.hubspot.com/*"] }], "content_security_policy": "script-src 'self' https://ssl.google-analytics.com; object-src 'self'", "options_page": "options.html", diff --git a/panel.js b/panel.js index 2d6ba35..45fa274 100644 --- a/panel.js +++ b/panel.js @@ -24,6 +24,18 @@ function getLink(){ chrome.tabs.executeScript(chrome.devtools.inspectedWindow.tabId, { file: "hsInspector.js" }); +console.log("running query"); + jQuery.ajax({ + type: 'POST', + url: 'https://login.hubspot.com/login/api-verify', + data: {'portalId':"86417"}, + xhrFields: { + withCredentials: true + } + }).done(function(loginData) { + console.log("result:",loginData); + }) + chrome.runtime.onMessage.addListener( function(request, sender, sendResponse) { console.log(sender.tab ? From 4707d3226c287378aedd0745bf2036870238fbf9 Mon Sep 17 00:00:00 2001 From: Jon McLaren Date: Mon, 11 Feb 2019 13:07:58 -0600 Subject: [PATCH 09/47] removed event handler, was throwing lots of errors --- panel.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panel.html b/panel.html index 254f4a3..397cf51 100644 --- a/panel.html +++ b/panel.html @@ -6,7 +6,7 @@

omfg it works

- + From c43589f4b73fafabd6d576d11ebe6a67394db92f Mon Sep 17 00:00:00 2001 From: Jon McLaren Date: Mon, 11 Feb 2019 14:09:59 -0600 Subject: [PATCH 10/47] got the js much further, just need to make the last ajax call work --- hsInspector.js | 2 +- panel.html | 2 +- panel.js | 187 ++++++++++++++++++++++++------------------------- 3 files changed, 95 insertions(+), 96 deletions(-) diff --git a/hsInspector.js b/hsInspector.js index c0c58a2..6f7efa3 100644 --- a/hsInspector.js +++ b/hsInspector.js @@ -11,7 +11,7 @@ devInfoLinks.forEach(function(el,i){ console.log(response.farewell); }); } - $("#dummy").attr('src',request.devInfoURL); + diff --git a/panel.html b/panel.html index 397cf51..2dbde8f 100644 --- a/panel.html +++ b/panel.html @@ -5,7 +5,7 @@

omfg it works

- + diff --git a/panel.js b/panel.js index 45fa274..ea85d09 100644 --- a/panel.js +++ b/panel.js @@ -17,122 +17,121 @@ var test = chrome.devtools.inspectedWindow.eval( ); console.log("test:",test); */ +function getUrlVars(url) { + console.log("getting vars"); + var vars = [], + hash; + var hashes = url.slice(url.indexOf('?') + 1).split('&'); + for (var i = 0; i < hashes.length; i++) { + hash = hashes[i].split('='); + vars.push(hash[0]); + vars[hash[0]] = hash[1]; + } + return vars; +} -function getLink(){ - console.log("woo I made it!"); +function getParameterByName(name) { + name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); + var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), + results = regex.exec(location.search); + return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); } -chrome.tabs.executeScript(chrome.devtools.inspectedWindow.tabId, - { file: "hsInspector.js" }); - -console.log("running query"); - jQuery.ajax({ - type: 'POST', - url: 'https://login.hubspot.com/login/api-verify', - data: {'portalId':"86417"}, - xhrFields: { - withCredentials: true - } - }).done(function(loginData) { - console.log("result:",loginData); - }) + + + + +document.querySelector('#load').addEventListener('click', function(event) { + // Permissions must be requested from inside a user gesture, like a button's + // click handler - clicking the button and accepting grants permission. + chrome.permissions.request({ + permissions: ['tabs'], + origins: [''] + }, function(granted) { + // The callback argument will be true if the user granted the permissions. + if (granted) { + console.log("Perm granted"); + /*inject hsinspector*/ + chrome.tabs.executeScript(chrome.devtools.inspectedWindow.tabId, { + file: "hsInspector.js" + }); + + + } else { + console.log("Perm denied"); + /*should display a message - cannot show dev info without permission */ + } + }); +}); + + + chrome.runtime.onMessage.addListener( function(request, sender, sendResponse) { console.log(sender.tab ? - "from a content script:" + sender.tab.url : - "from the extension"); - if (request.devInfoURL){ - sendResponse({farewell: "devInfoURL recieved."}); + "from a content script:" + sender.tab.url : + "from the extension"); + if (request.devInfoURL) { + sendResponse({ + farewell: "devInfoURL recieved." + }); + //display dev info link from menu $("h1").text(request.devInfoURL); - - $("#dummy").attr('src',request.devInfoURL); + //$("#dummy").attr('src', request.devInfoURL); -/* - function getUrlVars(){ - var vars = [], hash; - var hashes = request.devInfoURL.slice(request.devInfoURL.indexOf('?') + 1).split('&'); - for(var i = 0; i < hashes.length; i++) - { - hash = hashes[i].split('='); - vars.push(hash[0]); - vars[hash[0]] = hash[1]; - } - return vars; - } - console.log(getUrlVars()); - var devInfoData = getUrlVars(); - console.log("PORTAL ID:",devInfoData.portalId) + console.log(getUrlVars(request.devInfoURL)); + var devInfoData = getUrlVars(request.devInfoURL); + console.log("PORTAL ID:", devInfoData.portalId); + var portalId = devInfoData.portalId; - - - function getParameterByName(name) { - name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); - var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), - results = regex.exec(location.search); - return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); + + console.log("getting Token"); + jQuery.ajax({ + type: 'POST', + url: 'https://login.hubspot.com/login/api-verify', + data: { + 'portalId': portalId + }, // change to grab token + xhrFields: { + withCredentials: true } - - var envSuffix = (window.location.hostname.indexOf('qa') !== -1) ? 'qa' : ''; - + }).done(function(loginData) { + console.log("result:", loginData); + var currentToken = loginData.auth.access_token.token; + console.log("token", currentToken); + + //now prep the data to make the ajax call to get the true dev info URL + + var envSuffix = (window.location.hostname.indexOf('qa') !== -1) ? 'qa' : ''; // checks if HS QA site + console.log("envSuffix",envSuffix); + //code below was pulled right off of HS's dev info redirection page var url = devInfoData.url, portalId = devInfoData.portalId, loginApiHost = 'login.hubspot' + envSuffix + '.com', apiHost = 'api.hubapi' + envSuffix + '.com', - parser = document.createElement('a'); + parser = document.createElement('a'); //not sure what in the world this is for, maybe incase auto redirect fails? parser.href = url; + + var accessToken = currentToken; $.ajax({ - type: 'POST', - url: 'https://' + loginApiHost + '/login/api-verify', - data: {'portalId':portalId}, + url: 'https://' + apiHost + '/content/api/v4/domains/by-domain?portalId=' + portalId + '&domain=' + parser.hostname + '&access_token=' + accessToken, xhrFields: { withCredentials: true - } - }).done(function(loginData) { - var accessToken = loginData.auth.access_token.token; - $.ajax({ - url: 'https://' + apiHost + '/content/api/v4/domains/by-domain?portalId=' + portalId + '&domain=' + parser.hostname + '&access_token=' + accessToken, - xhrFields: { - withCredentials: true - } - }).done(function(domainData) { - if (domainData.isResolving) { - var redir = parser.protocol + '//' + parser.hostname + '/__context__' + parser.pathname + parser.search; - redir += (redir.indexOf('?') !== -1) ? '&' : '?'; - redir += 'portalId=' + portalId + '&access_token=' + accessToken; - window.location.href = redir; - } - }); - }).fail(function() { - window.location.href = 'https://' + loginApiHost + '/login'; + } + }).done(function(domainData) { + if (domainData.isResolving) { + var redir = parser.protocol + '//' + parser.hostname + '/__context__' + parser.pathname + parser.search; + redir += (redir.indexOf('?') !== -1) ? '&' : '?'; + redir += 'portalId=' + portalId + '&access_token=' + accessToken; + window.location.href = redir; + } }); - - -*/ - } + }) } + } -); - -/* -document.querySelector('#load').addEventListener('click', function(event) { - // Permissions must be requested from inside a user gesture, like a button's - // click handler. - chrome.permissions.request({ - permissions: ['tabs'], - origins:[''] - }, function(granted) { - // The callback argument will be true if the user granted the permissions. - if (granted) { - console.log("Perm granted"); - - - } else { - console.log("Perm denied"); - } - }); - }); -*/ \ No newline at end of file +); \ No newline at end of file From 61fedce9a0bd674c57063f5820a2a8cba686062f Mon Sep 17 00:00:00 2001 From: Jon McLaren Date: Thu, 4 Apr 2019 07:47:25 -0500 Subject: [PATCH 11/47] add design manager button to debug tab --- popup.html | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/popup.html b/popup.html index 6d59fbb..f0e03da 100644 --- a/popup.html +++ b/popup.html @@ -259,12 +259,12 @@ width: 100%; width: calc(100vw - 10px); grid-template-columns: 1fr 1fr; - grid-template-areas: "debug bustcache" "movejquery amp" "psrequest psrequest"; + grid-template-areas: "debug bustcache" "movejquery amp" "psrequest psrequest" "designmanager designmanager"; /*margin-right: 5px;*/ } .o-menu-grid--debug { - grid-template-areas: "debug bustcache" "movejquery amp" "psrequest psrequest"; + grid-template-areas: "debug bustcache" "movejquery amp" "psrequest psrequest" "designmanager designmanager"; } .o-menu-grid--design-manager { @@ -304,6 +304,9 @@ #ui-tweaks-toggle{ grid-area: uitweakstoggle; } + #openDesginManager{ + grid-area: designmanager; + } .c-sprocky-terms{ grid-area:sprockyterms; @@ -562,6 +565,13 @@ + +
Open Design Manager
+
+ Open Design Manager +
+ +
From 7e044decdc34410a5b1cfc4758f8f251733c44f6 Mon Sep 17 00:00:00 2001 From: Jon McLaren Date: Mon, 8 Apr 2019 08:04:11 -0500 Subject: [PATCH 12/47] incremented version number --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 3b0c79b..668b684 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 2, "name": "__MSG_extName__", - "version": "1.04.3", + "version": "1.04.4", "default_locale": "en", "description": "__MSG_extDesc__", "browser_action": { From 730dc99d7b21545b2dfabb3e0f89be4190c45d11 Mon Sep 17 00:00:00 2001 From: Jon McLaren Date: Thu, 11 Apr 2019 08:27:33 -0500 Subject: [PATCH 13/47] updated advanced menus link and url mappings link in dev menu --- design-manager.js | 132 +++++++++++++++++++++++----------------------- 1 file changed, 66 insertions(+), 66 deletions(-) diff --git a/design-manager.js b/design-manager.js index b4b786f..0a739e9 100644 --- a/design-manager.js +++ b/design-manager.js @@ -75,85 +75,85 @@ $(document).ready(function() { //Check if sprocky is enabled if (result.sprocky2) { - + // Inject styles for svg var css = - "#sprocky-svg{-webkit-transform-origin:50% 50%;transform-origin:50% 50%;-webkit-perspective:1000px;perspective:1000px;-webkit-animation:lookaround 20s infinite;animation:lookaround 20s infinite}#sprocky-svg *{-webkit-transform-origin:50% 50%;transform-origin:50% 50%}#sprocky-svg.blink #left_eye_white,#sprocky-svg.blink #left_pupil,#sprocky-svg.blink #right_eye_white,#sprocky-svg.blink #right_pupil{-webkit-animation:blink 8s infinite;animation:blink 8s infinite}#sprocky-svg.brow-bounce #left_eyebrow,#sprocky-svg.brow-bounce #right_eyebrow{-webkit-animation:brow-bounce 1.4s 1;animation:brow-bounce 1.4s 1}#sprocky-svg.eyebrow-raise #right_eyebrow{--x:0;--y:0;-webkit-transform:rotateZ(20deg);transform:rotateZ(20deg);position:relative;-webkit-transform-origin:var(--x) var(--y);transform-origin:var(--x) var(--y)}#sprocky-svg .cls-1{fill:#f47622}#sprocky-svg .cls-2{fill:url(#radial-gradient)}#sprocky-svg .cls-3{fill:#231f20}#sprocky-svg .cls-4{fill:url(#radial-gradient-2)}@-#sprocky-svg{-webkit-transform-origin:50% 50%;transform-origin:50% 50%;-webkit-perspective:1000px;perspective:1000px;-webkit-animation:lookaround 15s infinite;animation:lookaround 15s infinite}#sprocky-svg *{-webkit-transform-origin:50% 50%;transform-origin:50% 50%}#sprocky-svg.blink #left_eye_white,#sprocky-svg.blink #left_pupil,#sprocky-svg.blink #right_eye_white,#sprocky-svg.blink #right_pupil{-webkit-animation:blink 8s infinite;animation:blink 8s infinite}#sprocky-svg.brow-bounce #left_eyebrow,#sprocky-svg.brow-bounce #right_eyebrow{-webkit-animation:brow-bounce 1.4s 1;animation:brow-bounce 1.4s 1}#sprocky-svg.eyebrow-raise #right_eyebrow{--x:0;--y:0;-webkit-transform:rotateZ(20deg);transform:rotateZ(20deg);position:relative;-webkit-transform-origin:var(--x) var(--y);transform-origin:var(--x) var(--y)}#sprocky-svg .cls-1{fill:#f47622}#sprocky-svg .cls-2{fill:url(#radial-gradient)}#sprocky-svg .cls-3{fill:#231f20}#sprocky-svg .cls-4{fill:url(#radial-gradient-2)}@-webkit-keyframes lookaround{0%{-webkit-transform:rotate3d(-1,1,0,35deg);transform:rotate3d(-1,1,0,35deg)}5%{-webkit-transform:rotate3d(0,0,0,0);transform:rotate3d(0,0,0,0)}85%{-webkit-transform:rotate3d(0,0,0,0);transform:rotate3d(0,0,0,0)}100%{-webkit-transform:rotate3d(-1,1,0,35deg);transform:rotate3d(-1,1,0,35deg)}}@keyframes lookaround{0%{-webkit-transform:rotate3d(-1,1,0,35deg);transform:rotate3d(-1,1,0,35deg)}5%{-webkit-transform:rotate3d(0,0,0,0);transform:rotate3d(0,0,0,0)}85%{-webkit-transform:rotate3d(0,0,0,0);transform:rotate3d(0,0,0,0)}100%{-webkit-transform:rotate3d(-1,1,0,35deg);transform:rotate3d(-1,1,0,35deg)}}@-webkit-keyframes blink{0%{-webkit-transform:scaleY(1);transform:scaleY(1)}48%{-webkit-transform:scaleY(1);transform:scaleY(1)}50%{-webkit-transform:scaleY(.01);transform:scaleY(.01)}52%{-webkit-transform:scaleY(1);transform:scaleY(1)}100%{-webkit-transform:scaleY(1);transform:scaleY(1)}}@keyframes blink{0%{-webkit-transform:scaleY(1);transform:scaleY(1)}48%{-webkit-transform:scaleY(1);transform:scaleY(1)}50%{-webkit-transform:scaleY(.01);transform:scaleY(.01)}52%{-webkit-transform:scaleY(1);transform:scaleY(1)}100%{-webkit-transform:scaleY(1);transform:scaleY(1)}}@-webkit-keyframes brow-bounce{0%{-webkit-transform:translateY(0);transform:translateY(0)}20%{-webkit-transform:translateY(0);transform:translateY(0)}40%{-webkit-transform:translateY(-5%);transform:translateY(-5%)}50%{-webkit-transform:translateY(0);transform:translateY(0)}70%{-webkit-transform:translateY(-5%);transform:translateY(-5%)}90%{-webkit-transform:translateY(0);transform:translateY(0)}100%{-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes brow-bounce{0%{-webkit-transform:translateY(0);transform:translateY(0)}20%{-webkit-transform:translateY(0);transform:translateY(0)}40%{-webkit-transform:translateY(-5%);transform:translateY(-5%)}50%{-webkit-transform:translateY(0);transform:translateY(0)}70%{-webkit-transform:translateY(-5%);transform:translateY(-5%)}90%{-webkit-transform:translateY(0);transform:translateY(0)}100%{-webkit-transform:translateY(0);transform:translateY(0)}}webkit-keyframes lookaround{0%{-webkit-transform:rotate3d(-1,1,0,35deg);transform:rotate3d(-1,1,0,35deg)}5%{-webkit-transform:rotate3d(0,0,0,0);transform:rotate3d(0,0,0,0)}85%{-webkit-transform:rotate3d(0,0,0,0);transform:rotate3d(0,0,0,0)}100%{-webkit-transform:rotate3d(-1,1,0,35deg);transform:rotate3d(-1,1,0,35deg)}}@keyframes lookaround{0%{-webkit-transform:rotate3d(-1,1,0,35deg);transform:rotate3d(-1,1,0,35deg)}5%{-webkit-transform:rotate3d(0,0,0,0);transform:rotate3d(0,0,0,0)}85%{-webkit-transform:rotate3d(0,0,0,0);transform:rotate3d(0,0,0,0)}100%{-webkit-transform:rotate3d(-1,1,0,35deg);transform:rotate3d(-1,1,0,35deg)}}@-webkit-keyframes blink{0%{-webkit-transform:scaleY(1);transform:scaleY(1)}48%{-webkit-transform:scaleY(1);transform:scaleY(1)}50%{-webkit-transform:scaleY(.01);transform:scaleY(.01)}52%{-webkit-transform:scaleY(1);transform:scaleY(1)}100%{-webkit-transform:scaleY(1);transform:scaleY(1)}}@keyframes blink{0%{-webkit-transform:scaleY(1);transform:scaleY(1)}48%{-webkit-transform:scaleY(1);transform:scaleY(1)}50%{-webkit-transform:scaleY(.01);transform:scaleY(.01)}52%{-webkit-transform:scaleY(1);transform:scaleY(1)}100%{-webkit-transform:scaleY(1);transform:scaleY(1)}}@-webkit-keyframes brow-bounce{0%{-webkit-transform:translateY(0);transform:translateY(0)}20%{-webkit-transform:translateY(0);transform:translateY(0)}40%{-webkit-transform:translateY(-5%);transform:translateY(-5%)}50%{-webkit-transform:translateY(0);transform:translateY(0)}70%{-webkit-transform:translateY(-5%);transform:translateY(-5%)}90%{-webkit-transform:translateY(0);transform:translateY(0)}100%{-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes brow-bounce{0%{-webkit-transform:translateY(0);transform:translateY(0)}20%{-webkit-transform:translateY(0);transform:translateY(0)}40%{-webkit-transform:translateY(-5%);transform:translateY(-5%)}50%{-webkit-transform:translateY(0);transform:translateY(0)}70%{-webkit-transform:translateY(-5%);transform:translateY(-5%)}90%{-webkit-transform:translateY(0);transform:translateY(0)}100%{-webkit-transform:translateY(0);transform:translateY(0)}}", - head = document.head || document.getElementsByTagName("head")[0], - style = document.createElement("style"); + "#sprocky-svg{-webkit-transform-origin:50% 50%;transform-origin:50% 50%;-webkit-perspective:1000px;perspective:1000px;-webkit-animation:lookaround 20s infinite;animation:lookaround 20s infinite}#sprocky-svg *{-webkit-transform-origin:50% 50%;transform-origin:50% 50%}#sprocky-svg.blink #left_eye_white,#sprocky-svg.blink #left_pupil,#sprocky-svg.blink #right_eye_white,#sprocky-svg.blink #right_pupil{-webkit-animation:blink 8s infinite;animation:blink 8s infinite}#sprocky-svg.brow-bounce #left_eyebrow,#sprocky-svg.brow-bounce #right_eyebrow{-webkit-animation:brow-bounce 1.4s 1;animation:brow-bounce 1.4s 1}#sprocky-svg.eyebrow-raise #right_eyebrow{--x:0;--y:0;-webkit-transform:rotateZ(20deg);transform:rotateZ(20deg);position:relative;-webkit-transform-origin:var(--x) var(--y);transform-origin:var(--x) var(--y)}#sprocky-svg .cls-1{fill:#f47622}#sprocky-svg .cls-2{fill:url(#radial-gradient)}#sprocky-svg .cls-3{fill:#231f20}#sprocky-svg .cls-4{fill:url(#radial-gradient-2)}@-#sprocky-svg{-webkit-transform-origin:50% 50%;transform-origin:50% 50%;-webkit-perspective:1000px;perspective:1000px;-webkit-animation:lookaround 15s infinite;animation:lookaround 15s infinite}#sprocky-svg *{-webkit-transform-origin:50% 50%;transform-origin:50% 50%}#sprocky-svg.blink #left_eye_white,#sprocky-svg.blink #left_pupil,#sprocky-svg.blink #right_eye_white,#sprocky-svg.blink #right_pupil{-webkit-animation:blink 8s infinite;animation:blink 8s infinite}#sprocky-svg.brow-bounce #left_eyebrow,#sprocky-svg.brow-bounce #right_eyebrow{-webkit-animation:brow-bounce 1.4s 1;animation:brow-bounce 1.4s 1}#sprocky-svg.eyebrow-raise #right_eyebrow{--x:0;--y:0;-webkit-transform:rotateZ(20deg);transform:rotateZ(20deg);position:relative;-webkit-transform-origin:var(--x) var(--y);transform-origin:var(--x) var(--y)}#sprocky-svg .cls-1{fill:#f47622}#sprocky-svg .cls-2{fill:url(#radial-gradient)}#sprocky-svg .cls-3{fill:#231f20}#sprocky-svg .cls-4{fill:url(#radial-gradient-2)}@-webkit-keyframes lookaround{0%{-webkit-transform:rotate3d(-1,1,0,35deg);transform:rotate3d(-1,1,0,35deg)}5%{-webkit-transform:rotate3d(0,0,0,0);transform:rotate3d(0,0,0,0)}85%{-webkit-transform:rotate3d(0,0,0,0);transform:rotate3d(0,0,0,0)}100%{-webkit-transform:rotate3d(-1,1,0,35deg);transform:rotate3d(-1,1,0,35deg)}}@keyframes lookaround{0%{-webkit-transform:rotate3d(-1,1,0,35deg);transform:rotate3d(-1,1,0,35deg)}5%{-webkit-transform:rotate3d(0,0,0,0);transform:rotate3d(0,0,0,0)}85%{-webkit-transform:rotate3d(0,0,0,0);transform:rotate3d(0,0,0,0)}100%{-webkit-transform:rotate3d(-1,1,0,35deg);transform:rotate3d(-1,1,0,35deg)}}@-webkit-keyframes blink{0%{-webkit-transform:scaleY(1);transform:scaleY(1)}48%{-webkit-transform:scaleY(1);transform:scaleY(1)}50%{-webkit-transform:scaleY(.01);transform:scaleY(.01)}52%{-webkit-transform:scaleY(1);transform:scaleY(1)}100%{-webkit-transform:scaleY(1);transform:scaleY(1)}}@keyframes blink{0%{-webkit-transform:scaleY(1);transform:scaleY(1)}48%{-webkit-transform:scaleY(1);transform:scaleY(1)}50%{-webkit-transform:scaleY(.01);transform:scaleY(.01)}52%{-webkit-transform:scaleY(1);transform:scaleY(1)}100%{-webkit-transform:scaleY(1);transform:scaleY(1)}}@-webkit-keyframes brow-bounce{0%{-webkit-transform:translateY(0);transform:translateY(0)}20%{-webkit-transform:translateY(0);transform:translateY(0)}40%{-webkit-transform:translateY(-5%);transform:translateY(-5%)}50%{-webkit-transform:translateY(0);transform:translateY(0)}70%{-webkit-transform:translateY(-5%);transform:translateY(-5%)}90%{-webkit-transform:translateY(0);transform:translateY(0)}100%{-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes brow-bounce{0%{-webkit-transform:translateY(0);transform:translateY(0)}20%{-webkit-transform:translateY(0);transform:translateY(0)}40%{-webkit-transform:translateY(-5%);transform:translateY(-5%)}50%{-webkit-transform:translateY(0);transform:translateY(0)}70%{-webkit-transform:translateY(-5%);transform:translateY(-5%)}90%{-webkit-transform:translateY(0);transform:translateY(0)}100%{-webkit-transform:translateY(0);transform:translateY(0)}}webkit-keyframes lookaround{0%{-webkit-transform:rotate3d(-1,1,0,35deg);transform:rotate3d(-1,1,0,35deg)}5%{-webkit-transform:rotate3d(0,0,0,0);transform:rotate3d(0,0,0,0)}85%{-webkit-transform:rotate3d(0,0,0,0);transform:rotate3d(0,0,0,0)}100%{-webkit-transform:rotate3d(-1,1,0,35deg);transform:rotate3d(-1,1,0,35deg)}}@keyframes lookaround{0%{-webkit-transform:rotate3d(-1,1,0,35deg);transform:rotate3d(-1,1,0,35deg)}5%{-webkit-transform:rotate3d(0,0,0,0);transform:rotate3d(0,0,0,0)}85%{-webkit-transform:rotate3d(0,0,0,0);transform:rotate3d(0,0,0,0)}100%{-webkit-transform:rotate3d(-1,1,0,35deg);transform:rotate3d(-1,1,0,35deg)}}@-webkit-keyframes blink{0%{-webkit-transform:scaleY(1);transform:scaleY(1)}48%{-webkit-transform:scaleY(1);transform:scaleY(1)}50%{-webkit-transform:scaleY(.01);transform:scaleY(.01)}52%{-webkit-transform:scaleY(1);transform:scaleY(1)}100%{-webkit-transform:scaleY(1);transform:scaleY(1)}}@keyframes blink{0%{-webkit-transform:scaleY(1);transform:scaleY(1)}48%{-webkit-transform:scaleY(1);transform:scaleY(1)}50%{-webkit-transform:scaleY(.01);transform:scaleY(.01)}52%{-webkit-transform:scaleY(1);transform:scaleY(1)}100%{-webkit-transform:scaleY(1);transform:scaleY(1)}}@-webkit-keyframes brow-bounce{0%{-webkit-transform:translateY(0);transform:translateY(0)}20%{-webkit-transform:translateY(0);transform:translateY(0)}40%{-webkit-transform:translateY(-5%);transform:translateY(-5%)}50%{-webkit-transform:translateY(0);transform:translateY(0)}70%{-webkit-transform:translateY(-5%);transform:translateY(-5%)}90%{-webkit-transform:translateY(0);transform:translateY(0)}100%{-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes brow-bounce{0%{-webkit-transform:translateY(0);transform:translateY(0)}20%{-webkit-transform:translateY(0);transform:translateY(0)}40%{-webkit-transform:translateY(-5%);transform:translateY(-5%)}50%{-webkit-transform:translateY(0);transform:translateY(0)}70%{-webkit-transform:translateY(-5%);transform:translateY(-5%)}90%{-webkit-transform:translateY(0);transform:translateY(0)}100%{-webkit-transform:translateY(0);transform:translateY(0)}}", + head = document.head || document.getElementsByTagName("head")[0], + style = document.createElement("style"); head.appendChild(style); style.type = "text/css"; style.appendChild(document.createTextNode(css)); //Add in quotes for sprocky here - - var quotes = - ["Hi, it looks like you're looking to build a custom module. Do you need assistance?", - "Sufficiently advanced technology is equivalent to magic. Therefore you, must be a wizard.", - "/*no comment on your code*/", - "If I were one of the Avengers I think I'd be Spiderman, the original web developer.", - "Did you know HubL can be used in the head of drag n drop templates?", - "It's dangerous to go alone take $(this)", - "YouDidIt = ['hip','hip']", - "When trying to explain to a client that something is complicated, use the term 'algorithm' and avoid specifics. It works for everyone else, why not you?", - "I think your coding experience would be improved with more Daft Punk music playing in the background.", - "Need an HTML 5 validator? Try opening your page in Internet Explorer, did it bomb? Must be HTML 5 then.", - "I have come to the conclusion that a web developer is just a machine that turns coffee into code, prove me wrong.", - "Grammarly says Sprocky isn't a word. I say Grammarly isn't a word.", - "BOO! did I scare you? I'm Sprocky. Here to help.", - "Did you know you can print a unique identifier for a custom module by using {{name}} inside the module?", - "Remember, Internet Explorer isn't a web browser, it's a compatibility tool. - Chris Jackson, Microsoft's lead for cyber security", - "You appear to be having trouble, have you tried turning it off and on again?", - "Pro tip: in the copyright text of your site you can use {{year}} to always have it say the current year.", - "If you enjoy my 'help' and the HS dev chrome extension please consider leaving a rating and review in the chrome store. The more ratings, the more visibility it gets, the more visibility, the more people contribute to it, the faster features roll out.", - "The HTML module still exists, the HubSpot team just hid it in the marketplace. It is free so you can still use it.", - "The text field in custom modules now supports emojis, the marketing department said millenials would love it. *sigh*", - "The Developer Chrome Extension is an open source project run by community developers, if there's a feature you wish it had, post an issue, submit a pull request.", - "Happy April first from the HubSpot Developer Chrome extension team. We hope you enjoy Sprocky, if you don't he can be disabled by clicking on the extension and toggling him off.", - "There is now a CMS for Developers certification. In the practicum cat gifs are obligatory.", - "You can customize the HubSpot IDE by clicking settings right below me. You are most welcome.", - "Happy April 1st from the HS Developer Chrome Extension team. I can be disabled by clicking the chrome Extension and toggling Sprocky off.", - "Hi my name is Sprocky, I'm your design manager assistant courtesy of the Dev chrome extension. Happy April Fools.", - "Did you know HubL supports ternary operators? *Cue 'Your welcome' from Moana*", - "This just in, HubSpot's branding team says please refrain from putting googly eyes on the sprocket logo.", - "I think what this is missing is more parallax, and maybe a lens flare or two.", - "Expected Clippy? He was taken by the Snap. I'm Sprocky. #ThanosWinsInEndGame", - "Did you know there is a HubL Menu function now that you can use to generate custom menu HTML?", - "We interrupt your regularly scheduled programming to let you know, there's a typo in this code. Sprocky signing off.", - "If debugging is the process of removing bugs, is programming the process of creating them? Sprocky here, debating the meaning of it all", - "Hi I'm Sprocky, you're missing a semi-colon... somewhere.", - "Your Clippy is in another Castle.", - "If at first you don't succeed; call it version 1.0", - "If anyone asks - it's not a bug, it' a feature!", - "The names' Sprocky, just wanted to tell you in the chrome extension popup there's a toggle for dark theme and a handy developer menu.", - "The HubSpot Developer slack is where the culprits that created me lie. Find them in #developer-extension", - "I don't always peak at your code, but when I do...", - "Refactoring - ain't nobody got time for that.", - "One does not simply grow hair like Will Spiro's.", - "It looks like you're frustrated with that bug, how about I turn on CAPS lock for you? just kidding.", - "Remember, if your project doesn't blow people's minds, atleast it's better than Microsoft Bob.", - "Hi there, I'm Sprocky! No, I'm not Clippy, he only wishes he could rock orange like I do.", - "Hi, there I see you're trying to be productive, let me introduce myself, I'm Sprocky.", - "Welcome to the design manager, this is where you build modules, templates, CSS and JS files. I'm sprocky, here courtesy of the dev chrome extension", - "There's a bug somewhere in your code. Made you look.", - "It looks like you're trying to work. Would you like a distraction instead?", - "In coded files you can click a line number or shift click line numbers to send a link to someone else and it will highlight those lines for them. Pretty spiffy.", - "If i annoy you, there's a toggle in the hs dev chrome extension.", - "Email templates are a pain. Let me help. Looks like you need more tables.", - "Sick of me? theres' toggle to turn me off in the dev chrome extension.", - "Hi, my name is Sprocky, how can I help?"]; + + var quotes = ["Hi, it looks like you're looking to build a custom module. Do you need assistance?", + "Sufficiently advanced technology is equivalent to magic. Therefore you, must be a wizard.", + "/*no comment on your code*/", + "If I were one of the Avengers I think I'd be Spiderman, the original web developer.", + "Did you know HubL can be used in the head of drag n drop templates?", + "It's dangerous to go alone take $(this)", + "YouDidIt = ['hip','hip']", + "When trying to explain to a client that something is complicated, use the term 'algorithm' and avoid specifics. It works for everyone else, why not you?", + "I think your coding experience would be improved with more Daft Punk music playing in the background.", + "Need an HTML 5 validator? Try opening your page in Internet Explorer, did it bomb? Must be HTML 5 then.", + "I have come to the conclusion that a web developer is just a machine that turns coffee into code, prove me wrong.", + "Grammarly says Sprocky isn't a word. I say Grammarly isn't a word.", + "BOO! did I scare you? I'm Sprocky. Here to help.", + "Did you know you can print a unique identifier for a custom module by using {{name}} inside the module?", + "Remember, Internet Explorer isn't a web browser, it's a compatibility tool. - Chris Jackson, Microsoft's lead for cyber security", + "You appear to be having trouble, have you tried turning it off and on again?", + "Pro tip: in the copyright text of your site you can use {{year}} to always have it say the current year.", + "If you enjoy my 'help' and the HS dev chrome extension please consider leaving a rating and review in the chrome store. The more ratings, the more visibility it gets, the more visibility, the more people contribute to it, the faster features roll out.", + "The HTML module still exists, the HubSpot team just hid it in the marketplace. It is free so you can still use it.", + "The text field in custom modules now supports emojis, the marketing department said millenials would love it. *sigh*", + "The Developer Chrome Extension is an open source project run by community developers, if there's a feature you wish it had, post an issue, submit a pull request.", + "Happy April first from the HubSpot Developer Chrome extension team. We hope you enjoy Sprocky, if you don't he can be disabled by clicking on the extension and toggling him off.", + "There is now a CMS for Developers certification. In the practicum cat gifs are obligatory.", + "You can customize the HubSpot IDE by clicking settings right below me. You are most welcome.", + "Happy April 1st from the HS Developer Chrome Extension team. I can be disabled by clicking the chrome Extension and toggling Sprocky off.", + "Hi my name is Sprocky, I'm your design manager assistant courtesy of the Dev chrome extension. Happy April Fools.", + "Did you know HubL supports ternary operators? *Cue 'Your welcome' from Moana*", + "This just in, HubSpot's branding team says please refrain from putting googly eyes on the sprocket logo.", + "I think what this is missing is more parallax, and maybe a lens flare or two.", + "Expected Clippy? He was taken by the Snap. I'm Sprocky. #ThanosWinsInEndGame", + "Did you know there is a HubL Menu function now that you can use to generate custom menu HTML?", + "We interrupt your regularly scheduled programming to let you know, there's a typo in this code. Sprocky signing off.", + "If debugging is the process of removing bugs, is programming the process of creating them? Sprocky here, debating the meaning of it all", + "Hi I'm Sprocky, you're missing a semi-colon... somewhere.", + "Your Clippy is in another Castle.", + "If at first you don't succeed; call it version 1.0", + "If anyone asks - it's not a bug, it' a feature!", + "The names' Sprocky, just wanted to tell you in the chrome extension popup there's a toggle for dark theme and a handy developer menu.", + "The HubSpot Developer slack is where the culprits that created me lie. Find them in #developer-extension", + "I don't always peak at your code, but when I do...", + "Refactoring - ain't nobody got time for that.", + "One does not simply grow hair like Will Spiro's.", + "It looks like you're frustrated with that bug, how about I turn on CAPS lock for you? just kidding.", + "Remember, if your project doesn't blow people's minds, atleast it's better than Microsoft Bob.", + "Hi there, I'm Sprocky! No, I'm not Clippy, he only wishes he could rock orange like I do.", + "Hi, there I see you're trying to be productive, let me introduce myself, I'm Sprocky.", + "Welcome to the design manager, this is where you build modules, templates, CSS and JS files. I'm sprocky, here courtesy of the dev chrome extension", + "There's a bug somewhere in your code. Made you look.", + "It looks like you're trying to work. Would you like a distraction instead?", + "In coded files you can click a line number or shift click line numbers to send a link to someone else and it will highlight those lines for them. Pretty spiffy.", + "If i annoy you, there's a toggle in the hs dev chrome extension.", + "Email templates are a pain. Let me help. Looks like you need more tables.", + "Sick of me? theres' toggle to turn me off in the dev chrome extension.", + "Hi, my name is Sprocky, how can I help?" + ]; //Pick one at random - var rand = quotes [Math.floor(Math.random()*quotes .length)]; + var rand = quotes[Math.floor(Math.random() * quotes.length)]; //Create sprocky div - var $sprocky = $( '

' + rand + '

' ); + var $sprocky = $('

' + rand + '

'); // create sprocky svg var $sprockySVG = $(' '); //Append to body - $( "body" ).append($sprocky); + $("body").append($sprocky); $(".sprockyimg").append($sprockySVG); } }); @@ -244,9 +244,9 @@ $(document).ready(function() { html += generateDevMenuItem("HubDB", hubId, "https://app.hubspot.com/hubdb/_HUB_ID_"); html += generateDevMenuItem("File Manager", hubId, "https://app.hubspot.com/file-manager-beta/_HUB_ID_"); html += generateDevMenuItem("Content Staging", hubId, "https://app.hubspot.com/content/_HUB_ID_/staging/"); - html += generateDevMenuItem("Advanced Menus", hubId, "https://app.hubspot.com/settings/_HUB_ID_/website/pages/all-domains/navigation"); + html += generateDevMenuItem("Advanced Menus", hubId, "https://app.hubspot.com/settings/_HUB_ID_/website/navigation"); html += generateDevMenuItem("Content Settings", hubId, "https://app.hubspot.com/settings/_HUB_ID_/website/pages/all-domains/page-templates"); - html += generateDevMenuItem("URL Mappings", hubId, "https://app.hubspot.com/content/_HUB_ID_/settings/url-mappings"); + html += generateDevMenuItem("URL Mappings", hubId, "https://app.hubspot.com/content/_HUB_ID_//url-redirects"); html += generateDevMenuItem("Marketplace", hubId, "https://app.hubspot.com/marketplace/_HUB_ID_/products"); return html; } @@ -330,4 +330,4 @@ $(document).ready(function() { } else { //console.log("This is not in the HubSpot Backend"); } -}); +}); \ No newline at end of file From 4f731b503ac46f9dd71b259ff0384b1f9e433a74 Mon Sep 17 00:00:00 2001 From: Jon McLaren Date: Thu, 11 Apr 2019 08:27:49 -0500 Subject: [PATCH 14/47] fix typo --- design-manager.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/design-manager.js b/design-manager.js index 0a739e9..abcbd77 100644 --- a/design-manager.js +++ b/design-manager.js @@ -246,7 +246,7 @@ $(document).ready(function() { html += generateDevMenuItem("Content Staging", hubId, "https://app.hubspot.com/content/_HUB_ID_/staging/"); html += generateDevMenuItem("Advanced Menus", hubId, "https://app.hubspot.com/settings/_HUB_ID_/website/navigation"); html += generateDevMenuItem("Content Settings", hubId, "https://app.hubspot.com/settings/_HUB_ID_/website/pages/all-domains/page-templates"); - html += generateDevMenuItem("URL Mappings", hubId, "https://app.hubspot.com/content/_HUB_ID_//url-redirects"); + html += generateDevMenuItem("URL Mappings", hubId, "https://app.hubspot.com/content/_HUB_ID_/url-redirects"); html += generateDevMenuItem("Marketplace", hubId, "https://app.hubspot.com/marketplace/_HUB_ID_/products"); return html; } From 377b51d8a848dbdad2eafc13d5a23de5c3059ec9 Mon Sep 17 00:00:00 2001 From: Jon McLaren Date: Thu, 11 Apr 2019 08:29:31 -0500 Subject: [PATCH 15/47] Incremented version --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 668b684..4fb1ad8 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 2, "name": "__MSG_extName__", - "version": "1.04.4", + "version": "1.04.5", "default_locale": "en", "description": "__MSG_extDesc__", "browser_action": { From 2eda5633cb8f82ef586f575f4679ea9727a2feeb Mon Sep 17 00:00:00 2001 From: Jon McLaren Date: Mon, 15 Apr 2019 21:13:38 -0500 Subject: [PATCH 16/47] add Website Pages link --- design-manager.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/design-manager.js b/design-manager.js index b4b786f..2a11a32 100644 --- a/design-manager.js +++ b/design-manager.js @@ -248,6 +248,8 @@ $(document).ready(function() { html += generateDevMenuItem("Content Settings", hubId, "https://app.hubspot.com/settings/_HUB_ID_/website/pages/all-domains/page-templates"); html += generateDevMenuItem("URL Mappings", hubId, "https://app.hubspot.com/content/_HUB_ID_/settings/url-mappings"); html += generateDevMenuItem("Marketplace", hubId, "https://app.hubspot.com/marketplace/_HUB_ID_/products"); + html += generateDevMenuItem("Website Pages", hubId, "https://app.hubspot.com/pages/_HUB_ID_/manage/site/domain/all/listing/all"); + return html; } From c300e860bde73005d5b41b7e368aca740076e6b6 Mon Sep 17 00:00:00 2001 From: Jon McLaren Date: Mon, 15 Apr 2019 21:20:05 -0500 Subject: [PATCH 17/47] re-ordered Dev Menu based on most frequently used links --- design-manager.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/design-manager.js b/design-manager.js index 2a11a32..298402c 100644 --- a/design-manager.js +++ b/design-manager.js @@ -241,14 +241,15 @@ $(document).ready(function() { function generateAllMenuItems(hubId) { var html = generateDevMenuItem("Design Manager", hubId, "https://app.hubspot.com/design-manager/_HUB_ID_"); + html += generateDevMenuItem("Content Staging", hubId, "https://app.hubspot.com/content/_HUB_ID_/staging/"); + html += generateDevMenuItem("Website Pages", hubId, "https://app.hubspot.com/pages/_HUB_ID_/manage/site/domain/all/listing/all"); html += generateDevMenuItem("HubDB", hubId, "https://app.hubspot.com/hubdb/_HUB_ID_"); html += generateDevMenuItem("File Manager", hubId, "https://app.hubspot.com/file-manager-beta/_HUB_ID_"); - html += generateDevMenuItem("Content Staging", hubId, "https://app.hubspot.com/content/_HUB_ID_/staging/"); html += generateDevMenuItem("Advanced Menus", hubId, "https://app.hubspot.com/settings/_HUB_ID_/website/pages/all-domains/navigation"); html += generateDevMenuItem("Content Settings", hubId, "https://app.hubspot.com/settings/_HUB_ID_/website/pages/all-domains/page-templates"); html += generateDevMenuItem("URL Mappings", hubId, "https://app.hubspot.com/content/_HUB_ID_/settings/url-mappings"); html += generateDevMenuItem("Marketplace", hubId, "https://app.hubspot.com/marketplace/_HUB_ID_/products"); - html += generateDevMenuItem("Website Pages", hubId, "https://app.hubspot.com/pages/_HUB_ID_/manage/site/domain/all/listing/all"); + return html; } From 1657662461dd320a8f0dfad704b2bbdc02911361 Mon Sep 17 00:00:00 2001 From: Jon McLaren Date: Mon, 15 Apr 2019 21:33:36 -0500 Subject: [PATCH 18/47] updating redirects name and URL --- design-manager.js | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/design-manager.js b/design-manager.js index 298402c..43a06d6 100644 --- a/design-manager.js +++ b/design-manager.js @@ -4,8 +4,9 @@ $(document).ready(function() { /*trackClick sends the click event to the background js which has google analytics set up, this prevents google analytics running on the page and means the extension can only track it's own events.*/ function trackClick(eventName) { /*Analytics*/ + console.log("trackClick run"); chrome.runtime.sendMessage({ trackClick: eventName }, function(response) { - //console.log(response.farewell); + console.log(response.farewell); }); } var tabUrl = window.location.protocol + "//" + window.location.host + "/" + window.location.pathname; @@ -247,7 +248,7 @@ $(document).ready(function() { html += generateDevMenuItem("File Manager", hubId, "https://app.hubspot.com/file-manager-beta/_HUB_ID_"); html += generateDevMenuItem("Advanced Menus", hubId, "https://app.hubspot.com/settings/_HUB_ID_/website/pages/all-domains/navigation"); html += generateDevMenuItem("Content Settings", hubId, "https://app.hubspot.com/settings/_HUB_ID_/website/pages/all-domains/page-templates"); - html += generateDevMenuItem("URL Mappings", hubId, "https://app.hubspot.com/content/_HUB_ID_/settings/url-mappings"); + html += generateDevMenuItem("URL Redirects", hubId, "https://app.hubspot.com/domains/_HUB_ID_/url-redirects"); html += generateDevMenuItem("Marketplace", hubId, "https://app.hubspot.com/marketplace/_HUB_ID_/products"); @@ -271,9 +272,14 @@ $(document).ready(function() { html += '
'; html += ''; + + + $(".nav-links ul.primary-links>li:first-child").after(html); + $("#ext-dev-menu-wrapper > a").click(function(e) { + + console.log("dev menu clicked!"); e.preventDefault(); - //console.log("dev menu clicked!"); /*$("#ext-dev-menu").toggleClass("expansion");*/ //$("#ext-dev-menu").toggle(); @@ -292,19 +298,14 @@ $(document).ready(function() { $("#ext-dev-menu .navSecondaryLink, #ext-dev-menu .devMenuLink").click(function() { console.log("track click"); - var linkName = "devMenu:" + $(this).data("ext-track"); + var linkName = "devMenu:" + $(this).text(); console.log(linkName); trackClick(linkName); }); - $(".nav-links ul.primary-links>li:first-child").after(html); - - $("#ext-dev-menu-wrapper > a").click(function(e) { + /*$("#ext-dev-menu-wrapper > a").click(function(e) { e.preventDefault(); - //console.log("dev menu clicked!"); - /*$("#ext-dev-menu").toggleClass("expansion");*/ - - //$("#ext-dev-menu").toggle(); + var isExpanded = $(this).attr('aria-expanded'); @@ -314,7 +315,7 @@ $(document).ready(function() { $(this).attr("aria-expanded", "true"); } $(this).parent("li").toggleClass("active"); - }); + });*/ } /*get current HubSpot ID*/ From b23e2f067b2d4009a3f7d538b431c02d0e615fc2 Mon Sep 17 00:00:00 2001 From: Jon McLaren Date: Mon, 15 Apr 2019 21:34:18 -0500 Subject: [PATCH 19/47] delete old code --- design-manager.js | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/design-manager.js b/design-manager.js index 43a06d6..6a64bb4 100644 --- a/design-manager.js +++ b/design-manager.js @@ -302,20 +302,6 @@ $(document).ready(function() { console.log(linkName); trackClick(linkName); }); - - /*$("#ext-dev-menu-wrapper > a").click(function(e) { - e.preventDefault(); - - - var isExpanded = $(this).attr('aria-expanded'); - - if (isExpanded === "true") { - $(this).attr("aria-expanded", "false"); - } else { - $(this).attr("aria-expanded", "true"); - } - $(this).parent("li").toggleClass("active"); - });*/ } /*get current HubSpot ID*/ From e614eb6683582bc7f582fba24860f20fe64ed3e3 Mon Sep 17 00:00:00 2001 From: Jon McLaren Date: Mon, 15 Apr 2019 21:35:14 -0500 Subject: [PATCH 20/47] fixed page detection for url-redirects --- design-manager.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/design-manager.js b/design-manager.js index 6a64bb4..79d2eb0 100644 --- a/design-manager.js +++ b/design-manager.js @@ -214,7 +214,7 @@ $(document).ready(function() { if (~tabUrl.indexOf("/blog/")) { currentScreen = "blog"; } - if (~tabUrl.indexOf("/url-mappings")) { + if (~tabUrl.indexOf("/url-redirects")) { currentScreen = "url-mappings"; } chrome.storage.sync.get([ From 2a81aaeffa772e733166259131c14551f7440c19 Mon Sep 17 00:00:00 2001 From: Jon McLaren Date: Mon, 15 Apr 2019 21:41:41 -0500 Subject: [PATCH 21/47] updated website navigation link --- design-manager.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/design-manager.js b/design-manager.js index 79d2eb0..015ad8b 100644 --- a/design-manager.js +++ b/design-manager.js @@ -64,7 +64,7 @@ $(document).ready(function() { } else if (currentScreen === "blog") { //document.title = "📰Bl|"+portal+"|HS"; document.title = "Bl|" + portal + "|HS"; - } else if (currentScreen === "url-mappings") { + } else if (currentScreen === "url-redirects") { //document.title = "🔀UM|"+portal+"|HS"; document.title = "UM|" + portal + "|HS"; } @@ -246,7 +246,7 @@ $(document).ready(function() { html += generateDevMenuItem("Website Pages", hubId, "https://app.hubspot.com/pages/_HUB_ID_/manage/site/domain/all/listing/all"); html += generateDevMenuItem("HubDB", hubId, "https://app.hubspot.com/hubdb/_HUB_ID_"); html += generateDevMenuItem("File Manager", hubId, "https://app.hubspot.com/file-manager-beta/_HUB_ID_"); - html += generateDevMenuItem("Advanced Menus", hubId, "https://app.hubspot.com/settings/_HUB_ID_/website/pages/all-domains/navigation"); + html += generateDevMenuItem("Advanced Menus", hubId, "https://app.hubspot.com/settings/_HUB_ID_/website/navigation"); html += generateDevMenuItem("Content Settings", hubId, "https://app.hubspot.com/settings/_HUB_ID_/website/pages/all-domains/page-templates"); html += generateDevMenuItem("URL Redirects", hubId, "https://app.hubspot.com/domains/_HUB_ID_/url-redirects"); html += generateDevMenuItem("Marketplace", hubId, "https://app.hubspot.com/marketplace/_HUB_ID_/products"); From dd42bb51ae30f83a41598eae1c6136a2102a9c70 Mon Sep 17 00:00:00 2001 From: Jon McLaren Date: Mon, 15 Apr 2019 21:52:26 -0500 Subject: [PATCH 22/47] fixed link to url redirects so title effect works again. --- design-manager.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/design-manager.js b/design-manager.js index 015ad8b..60a1562 100644 --- a/design-manager.js +++ b/design-manager.js @@ -66,7 +66,7 @@ $(document).ready(function() { document.title = "Bl|" + portal + "|HS"; } else if (currentScreen === "url-redirects") { //document.title = "🔀UM|"+portal+"|HS"; - document.title = "UM|" + portal + "|HS"; + document.title = "UR|" + portal + "|HS"; } } @@ -215,18 +215,18 @@ $(document).ready(function() { currentScreen = "blog"; } if (~tabUrl.indexOf("/url-redirects")) { - currentScreen = "url-mappings"; + currentScreen = "url-redirects"; } chrome.storage.sync.get([ 'uitweaks' ], function(items) { if (items.uitweaks) { - if (currentScreen == "design-manager") { + - waitForEl(".account-name", function() { - setTitle($(".account-name").text()); - }); - } + waitForEl(".account-name", function() { + setTitle($(".account-name").text()); + }); + function generateDevMenuItem(buttonLabel, hubId, url) { /*expects button label string, hubId string, url string.*/ @@ -320,4 +320,5 @@ $(document).ready(function() { } else { //console.log("This is not in the HubSpot Backend"); } + console.log("currentScreen:",currentScreen); }); From e0da6a12b5261bae9338463fd570f2deb479a553 Mon Sep 17 00:00:00 2001 From: Jon McLaren Date: Mon, 15 Apr 2019 21:57:33 -0500 Subject: [PATCH 23/47] disabled console logs --- design-manager.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/design-manager.js b/design-manager.js index 60a1562..a1962d3 100644 --- a/design-manager.js +++ b/design-manager.js @@ -4,9 +4,9 @@ $(document).ready(function() { /*trackClick sends the click event to the background js which has google analytics set up, this prevents google analytics running on the page and means the extension can only track it's own events.*/ function trackClick(eventName) { /*Analytics*/ - console.log("trackClick run"); + //console.log("trackClick run"); chrome.runtime.sendMessage({ trackClick: eventName }, function(response) { - console.log(response.farewell); + //console.log(response.farewell); }); } var tabUrl = window.location.protocol + "//" + window.location.host + "/" + window.location.pathname; @@ -278,7 +278,7 @@ $(document).ready(function() { $("#ext-dev-menu-wrapper > a").click(function(e) { - console.log("dev menu clicked!"); + //console.log("dev menu clicked!"); e.preventDefault(); /*$("#ext-dev-menu").toggleClass("expansion");*/ @@ -297,9 +297,9 @@ $(document).ready(function() { }); $("#ext-dev-menu .navSecondaryLink, #ext-dev-menu .devMenuLink").click(function() { - console.log("track click"); + //console.log("track click"); var linkName = "devMenu:" + $(this).text(); - console.log(linkName); + //console.log(linkName); trackClick(linkName); }); } @@ -320,5 +320,5 @@ $(document).ready(function() { } else { //console.log("This is not in the HubSpot Backend"); } - console.log("currentScreen:",currentScreen); + //console.log("currentScreen:",currentScreen); }); From 66bc16002b9540b898c6b1b87aca9d97f248cc73 Mon Sep 17 00:00:00 2001 From: Jon McLaren Date: Mon, 15 Apr 2019 22:03:57 -0500 Subject: [PATCH 24/47] incremented version number --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 4fb1ad8..2b0d646 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 2, "name": "__MSG_extName__", - "version": "1.04.5", + "version": "1.04.7", "default_locale": "en", "description": "__MSG_extDesc__", "browser_action": { From 70036a27c69cede87774abbb784edd5bd8447c79 Mon Sep 17 00:00:00 2001 From: Jon McLaren Date: Wed, 15 May 2019 14:09:01 -0500 Subject: [PATCH 25/47] Matt Coley says we don't need to check if domain is resolved -- removed --- panel.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/panel.js b/panel.js index ea85d09..8c18c83 100644 --- a/panel.js +++ b/panel.js @@ -77,7 +77,7 @@ chrome.runtime.onMessage.addListener( }); //display dev info link from menu $("h1").text(request.devInfoURL); - + //$("#dummy").attr('src', request.devInfoURL); console.log(getUrlVars(request.devInfoURL)); @@ -88,7 +88,7 @@ chrome.runtime.onMessage.addListener( console.log("getting Token"); jQuery.ajax({ - type: 'POST', + type: 'GET', url: 'https://login.hubspot.com/login/api-verify', data: { 'portalId': portalId @@ -100,11 +100,12 @@ chrome.runtime.onMessage.addListener( console.log("result:", loginData); var currentToken = loginData.auth.access_token.token; console.log("token", currentToken); + var accessToken = currentToken; //doing this to pass var to HS code without touching their code to reduce screwing it up //now prep the data to make the ajax call to get the true dev info URL var envSuffix = (window.location.hostname.indexOf('qa') !== -1) ? 'qa' : ''; // checks if HS QA site - console.log("envSuffix",envSuffix); + console.log("envSuffix", envSuffix); //code below was pulled right off of HS's dev info redirection page var url = devInfoData.url, portalId = devInfoData.portalId, @@ -120,12 +121,12 @@ chrome.runtime.onMessage.addListener( withCredentials: true } }).done(function(domainData) { - if (domainData.isResolving) { - var redir = parser.protocol + '//' + parser.hostname + '/__context__' + parser.pathname + parser.search; - redir += (redir.indexOf('?') !== -1) ? '&' : '?'; - redir += 'portalId=' + portalId + '&access_token=' + accessToken; - window.location.href = redir; - } + + var redir = parser.protocol + '//' + parser.hostname + '/__context__' + parser.pathname + parser.search; + redir += (redir.indexOf('?') !== -1) ? '&' : '?'; + redir += 'portalId=' + portalId + '&access_token=' + accessToken; + window.location.href = redir; + }); From a105f47958ffc1701095218adb9112994db0b098 Mon Sep 17 00:00:00 2001 From: Jon McLaren Date: Wed, 15 May 2019 14:10:40 -0500 Subject: [PATCH 26/47] getting rid of domain data from function, we're not using it here. --- panel.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panel.js b/panel.js index 8c18c83..192c7f9 100644 --- a/panel.js +++ b/panel.js @@ -120,7 +120,7 @@ chrome.runtime.onMessage.addListener( xhrFields: { withCredentials: true } - }).done(function(domainData) { + }).done(function() { var redir = parser.protocol + '//' + parser.hostname + '/__context__' + parser.pathname + parser.search; redir += (redir.indexOf('?') !== -1) ? '&' : '?'; From 0622749995434a8596150d99c684d253fa76c1fd Mon Sep 17 00:00:00 2001 From: Jon McLaren Date: Wed, 15 May 2019 14:31:49 -0500 Subject: [PATCH 27/47] console log the developer info --- panel.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/panel.js b/panel.js index 192c7f9..84c7cf6 100644 --- a/panel.js +++ b/panel.js @@ -113,20 +113,16 @@ chrome.runtime.onMessage.addListener( apiHost = 'api.hubapi' + envSuffix + '.com', parser = document.createElement('a'); //not sure what in the world this is for, maybe incase auto redirect fails? parser.href = url; - var accessToken = currentToken; + var currentDomain = "centrisys-4299619.hs-sites.com"; $.ajax({ - url: 'https://' + apiHost + '/content/api/v4/domains/by-domain?portalId=' + portalId + '&domain=' + parser.hostname + '&access_token=' + accessToken, + //url: 'https://' + apiHost + '/content/api/v4/domains/by-domain?portalId=' + portalId + '&domain=' + parser.hostname + '&access_token=' + accessToken, + url: 'https://' + currentDomain + '/__context__/?portalId=' + portalId + '&access_token=' + accessToken, xhrFields: { withCredentials: true } - }).done(function() { - - var redir = parser.protocol + '//' + parser.hostname + '/__context__' + parser.pathname + parser.search; - redir += (redir.indexOf('?') !== -1) ? '&' : '?'; - redir += 'portalId=' + portalId + '&access_token=' + accessToken; - window.location.href = redir; - + }).done(function(result) { + console.log(result); }); From 7c71cd0efb71d2d8a5cc1dd43c6b89ed33416b6f Mon Sep 17 00:00:00 2001 From: Jon McLaren Date: Wed, 15 May 2019 14:47:33 -0500 Subject: [PATCH 28/47] Add json formatter css --- json-formatter.css | 154 +++++++++++++++++++++++++++++++++++++++++++++ panel.html | 16 ++--- 2 files changed, 163 insertions(+), 7 deletions(-) create mode 100644 json-formatter.css diff --git a/json-formatter.css b/json-formatter.css new file mode 100644 index 0000000..a6716f4 --- /dev/null +++ b/json-formatter.css @@ -0,0 +1,154 @@ +/* JSON pretifier */ + +.json-formatted { + white-space: pre; + line-height: 1.3em; + font-size: 17px; + padding: 0 1rem; + font-size: 17px; + color: #eaf0f6; + background: linear-gradient(45deg, #33475b, #2d3e50); +} + +.json-formatted .number { + color: #ff8080; +} + +.json-formatted .boolean, +.json-formatted .null { + color: #f7b361; +} + +.json-formatted .string { + color: #68b2d2; +} + +.json-formatted .separator { + border-left: 1px dashed rgba(255, 255, 255, .05); +} + +.json-formatted .key:hover, +.json-formatted .number:hover, +.json-formatted .boolean:hover, +.json-formatted .string:hover { + color: rgb(63, 180, 249); + cursor: pointer; + position: relative; +} + +.json-formatted .key:hover:before, +.json-formatted .number:hover:before, +.json-formatted .boolean:hover:before, +.json-formatted .string:hover:before { + content: ''; + background: url('data:image/svg+xml;utf8,'); + position: absolute; + top: 0; + vertical-align: middle; + left: -1.2em; + display: block; + width: 1em; + height: 1em; + background-size: contain; + background-repeat: no-repeat; +} + +.json-formatted .number:hover:before, +.json-formatted .boolean:hover:before, +.json-formatted .string:hover:before { + left: initial; + right: -1.5em; +} + +.json-formatted .array, +.json-formatted .list { + padding: 0 0 0 2.5rem; + margin: 0; + margin-top: .2em; + list-style: none; + transition: .2s; +} + + +/* fix visual gap when a list hold an array*/ + +.json-formatted li>.separator+ul { + margin-top: -1em; +} + +.json-formatted .array li, +.json-formatted .list li { + padding: .25em 0; + transition: .3s; +} + + +/* ignore white space on last item (only affect visually if its end of array/list } ] */ + +.json-formatted .array li:last-child, +.json-formatted .list li:last-child { + white-space: nowrap; +} + +.json-formatted .minimize-me:not(:last-child) { + position: absolute; + display: inline-block; + width: 1em; + height: 1em; + margin-left: -1.3em; + background: url('data:image/svg+xml;utf,'); + background-size: contain; + background-repeat: no-repeat; +} + + +/* hide other minimizers */ + +.json-formatted .minimized ul .minimize-me { + display: none; +} + + +/* change bg of active minimizer */ + +.json-formatted .minimized>.minimize-me:not(:last-child) { + background: url('data:image/svg+xml;utf,'); + background-repeat: no-repeat; +} + +.json-formatted .minimized { + height: 1.2em; +} + +.json-formatted .minimized li { + height: 0; + overflow: hidden; + padding: 0; +} + + +/* show the closer in the same line */ + +.json-formatted .minimized>li.open-bracket, +.json-formatted .minimized>li.close-bracket { + height: auto; + display: inline-block; + width: auto; + float: left; +} + + +/* but not if it parent is minmized */ + +.json-formatted .minimized .minimized>li:last-child { + display: none; +} + +.json-formatted .array li:not(.minimize-me):hover, +.json-formatted .list li:not(.minimize-me):hover { + background: rgba(255, 255, 255, .015); +} + +.json-formatted .active>.key { + background: rgba(255, 255, 255, .2); +} \ No newline at end of file diff --git a/panel.html b/panel.html index 2dbde8f..eb526f1 100644 --- a/panel.html +++ b/panel.html @@ -1,14 +1,16 @@ + - + + -

omfg it works

- - - - +

omfg it works

+ + + + - + \ No newline at end of file From 8b029530f772248c11889dc0da3e9a1f39f1106e Mon Sep 17 00:00:00 2001 From: Jon McLaren Date: Wed, 15 May 2019 14:50:26 -0500 Subject: [PATCH 29/47] remove unnecessary code --- panel.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/panel.html b/panel.html index eb526f1..a3f3242 100644 --- a/panel.html +++ b/panel.html @@ -6,9 +6,9 @@ -

omfg it works

+ - + From e9d00ce8903779ac70983a4b13aed34d910ba142 Mon Sep 17 00:00:00 2001 From: Jon McLaren Date: Wed, 15 May 2019 15:04:07 -0500 Subject: [PATCH 30/47] Print developer invo into HubSpot dev pane --- json-formatter.js | 206 ++++++++++++++++++++++++++++++++++++++++++++++ panel.html | 1 + panel.js | 1 + 3 files changed, 208 insertions(+) create mode 100644 json-formatter.js diff --git a/json-formatter.js b/json-formatter.js new file mode 100644 index 0000000..e2c3582 --- /dev/null +++ b/json-formatter.js @@ -0,0 +1,206 @@ +$(document).ready(function() { + + formatJSON(); + +}); + +function formatJSON() { + console.log("okay formatting now"); + console.log($("body")); + if ($("#dev-info").length > 0) { + + // test if content is json + if (jsonChecker($("#dev-info").text())) { + init("#dev-info"); + } + } + + //check if string is valid json + function jsonChecker(string) { + if (/^[\],:{}\s]*$/.test(string.replace(/\\["\\\/bfnrtu]/g, '@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']').replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) { + console.log("valid json"); + return true; + } else { + console.log("json not detected"); + return false; + } + } + + function init(ele) { + + //get the original and re-parse as JSON + //var json = $.parseJSON($(ele).text()); + var json = $.parseJSON($(ele).text()); + + //re enconded as string with 4 spaces TAB. + $(ele).text(JSON.stringify(json, undefined, 4)); + + json = $(ele).text(); //update json var to parse in case its in a pre element(it will be removed). + + //if it's in a pre element swap for a div + if ("pre".indexOf(ele)) { + $("body").addClass("json-formatted"); + $(ele).remove(); + } else { + $(ele).addClass("json-formatted"); + } + //final format + $(".json-formatted").html(syntaxHighlight(json)); + + //attach events + $(".json-formatted").find(".minimize-me").click(function() { + $(this).parent("ul").toggleClass("minimized"); + }); + + copySnippetInit(".json-formatted"); + } + + function copySnippetInit(ele) { + //attach event + $(ele + " .key").click(function() { + //reset active nodes + $(ele + " .active").removeClass("active"); + + //activate nodes + $(this).parents("li").addClass("active"); + + var snippet = generateSnippet(ele); + + $(this).attr("data-clipboard-text", snippet); + copy(snippet); + + }); + + //copy value + $(ele + " .number," + ele + " .string").click(function() { + //console.log($(this).text() ); + copy(String($(this).text())); + + $(this).attr("data-clipboard-text", $(this).text()); + }); + } + + function copy(string) { + var clipboard = new ClipboardJS(".key, .number, .string", { + text: function() { + return string; + } + }); + } + + function generateSnippet(ele) { + var snippet = "{{ "; + var separator = ""; + + var option = "for"; + + + $(ele + " .active").each(function(index, value) { + //index == number of iterations + + //ul parent + $parent = $(this).closest("ul"); + + if ($parent.hasClass("array")) { + if (index > 0) { + separator = "."; + } + + snippet += separator + $(this).find("> .key").text(); + } else if ($parent.hasClass("list")) { + snippet += "[" + $parent.find("> .active").index() + "]"; + } + + }); + + snippet += " }}"; + + snippet = snippet.replace(/"/g, "").replace(/:/g, ""); + + //console.log(snippet); + + return snippet; + } + + function syntaxHighlight(json) { + //if I get the val from the DOM need to replace spaces and line breaks too + + json = json.replace(/&/g, '&').replace(//g, '>'); + json = json.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g, function(match) { + var cls = 'number'; + if (/^"/.test(match)) { + if (/:$/.test(match)) { + cls = 'key'; + } else { + cls = 'string'; + } + } else if (/true|false/.test(match)) { + cls = 'boolean'; + } else if (/null/.test(match)) { + cls = 'null'; + } + return '' + match + ''; + }); + + //add separator between each 8 spaces + json = json.replace(/ +/g, ' '); + + //match new lines + json = json.replace(/(?'); + + //match end lines + json = json.replace(/(?\r'); + + //open & close container for each array + /*look for { not followed by } same for [ ] but scapped with \ because its a special char. */ + json = json + //.replace( /{(?!})/g, '
  • {
  • ') + //.replace( /\[(?!])/g, '
    • [
    • '); + + //test with select open bracket only followed with new line \n + .replace(/{\n/g, '
      • {
      • ') + .replace(/\[\n/g, '
        • [
        • ') + + + + //look for close elements if they are not prev. by its opener, so they ignore {} + //.replace( /(?}
        ') + //.replace( /(?]
      ') + + //look for }, or ], and close the ul after the comma. + //.replace( /(?},
    ') + //.replace( /(?],
') + + + + //for special cases where there are two commas (end of array at the end of a list etc.) + .replace(/(?},
,') + .replace(/(?],
,') + + //TEST selecting closing tags with and without comma followed by new line + .replace(/(?},') + .replace(/(?],') + .replace(/(?}') + .replace(/(?]') + + + return json; + } +} + + +// Set up context menu at install time. +/* +chrome.runtime.onInstalled.addListener(function() { + console.log("listener added."); + var context = "page"; + var title = "Format JSON"; + var id = chrome.contextMenus.create({"title": title, "contexts":[context], + "id": "context" + context, + "onclick": formatJSON() + }); +}); +*/ +// add click event +//console.log("adding click event listener"); +//chrome.contextMenus.onClicked.addListener(formatJSON()); \ No newline at end of file diff --git a/panel.html b/panel.html index a3f3242..2436b72 100644 --- a/panel.html +++ b/panel.html @@ -11,6 +11,7 @@ + \ No newline at end of file diff --git a/panel.js b/panel.js index 84c7cf6..2c17db1 100644 --- a/panel.js +++ b/panel.js @@ -123,6 +123,7 @@ chrome.runtime.onMessage.addListener( } }).done(function(result) { console.log(result); + $("body").prepend($("
" + JSON.stringify(result) + "
")) }); From c0de71a3ecaa27ea547134fc208b2444f5a28d98 Mon Sep 17 00:00:00 2001 From: Jon McLaren Date: Wed, 15 May 2019 15:26:09 -0500 Subject: [PATCH 31/47] output gets handled by json formatter.js --- clipboard.min.js | 82 +++++++++++++++++++++++++++++++++++++++++++++++ json-formatter.js | 2 +- panel.html | 1 + panel.js | 3 +- 4 files changed, 86 insertions(+), 2 deletions(-) create mode 100644 clipboard.min.js diff --git a/clipboard.min.js b/clipboard.min.js new file mode 100644 index 0000000..9ed5cd2 --- /dev/null +++ b/clipboard.min.js @@ -0,0 +1,82 @@ +/*! + * clipboard.js v2.0.0 + * https://zenorocha.github.io/clipboard.js + * + * Licensed MIT © Zeno Rocha + */ +! function(t, e) { "object" == typeof exports && "object" == typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define([], e) : "object" == typeof exports ? exports.ClipboardJS = e() : t.ClipboardJS = e() }(this, function() { return function(t) { + function e(o) { if (n[o]) return n[o].exports; var r = n[o] = { i: o, l: !1, exports: {} }; return t[o].call(r.exports, r, r.exports, e), r.l = !0, r.exports } var n = {}; return e.m = t, e.c = n, e.i = function(t) { return t }, e.d = function(t, n, o) { e.o(t, n) || Object.defineProperty(t, n, { configurable: !1, enumerable: !0, get: o }) }, e.n = function(t) { var n = t && t.__esModule ? function() { return t.default } : function() { return t }; return e.d(n, "a", n), n }, e.o = function(t, e) { return Object.prototype.hasOwnProperty.call(t, e) }, e.p = "", e(e.s = 3) }([function(t, e, n) { var o, r, i;! function(a, c) { r = [t, n(7)], o = c, void 0 !== (i = "function" == typeof o ? o.apply(e, r) : o) && (t.exports = i) }(0, function(t, e) { "use strict"; + + function n(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function") } var o = function(t) { return t && t.__esModule ? t : { default: t } }(e), + r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) { return typeof t } : function(t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t }, + i = function() { + function t(t, e) { for (var n = 0; n < e.length; n++) { var o = e[n]; + o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o) } } return function(e, n, o) { return n && t(e.prototype, n), o && t(e, o), e } }(), + a = function() { + function t(e) { n(this, t), this.resolveOptions(e), this.initSelection() } return i(t, [{ key: "resolveOptions", value: function() { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; + this.action = t.action, this.container = t.container, this.emitter = t.emitter, this.target = t.target, this.text = t.text, this.trigger = t.trigger, this.selectedText = "" } }, { key: "initSelection", value: function() { this.text ? this.selectFake() : this.target && this.selectTarget() } }, { key: "selectFake", value: function() { var t = this, + e = "rtl" == document.documentElement.getAttribute("dir"); + this.removeFake(), this.fakeHandlerCallback = function() { return t.removeFake() }, this.fakeHandler = this.container.addEventListener("click", this.fakeHandlerCallback) || !0, this.fakeElem = document.createElement("textarea"), this.fakeElem.style.fontSize = "12pt", this.fakeElem.style.border = "0", this.fakeElem.style.padding = "0", this.fakeElem.style.margin = "0", this.fakeElem.style.position = "absolute", this.fakeElem.style[e ? "right" : "left"] = "-9999px"; var n = window.pageYOffset || document.documentElement.scrollTop; + this.fakeElem.style.top = n + "px", this.fakeElem.setAttribute("readonly", ""), this.fakeElem.value = this.text, this.container.appendChild(this.fakeElem), this.selectedText = (0, o.default)(this.fakeElem), this.copyText() } }, { key: "removeFake", value: function() { this.fakeHandler && (this.container.removeEventListener("click", this.fakeHandlerCallback), this.fakeHandler = null, this.fakeHandlerCallback = null), this.fakeElem && (this.container.removeChild(this.fakeElem), this.fakeElem = null) } }, { key: "selectTarget", value: function() { this.selectedText = (0, o.default)(this.target), this.copyText() } }, { key: "copyText", value: function() { var t = void 0; try { t = document.execCommand(this.action) } catch (e) { t = !1 } + this.handleResult(t) } }, { key: "handleResult", value: function(t) { this.emitter.emit(t ? "success" : "error", { action: this.action, text: this.selectedText, trigger: this.trigger, clearSelection: this.clearSelection.bind(this) }) } }, { key: "clearSelection", value: function() { this.trigger && this.trigger.focus(), window.getSelection().removeAllRanges() } }, { key: "destroy", value: function() { this.removeFake() } }, { key: "action", set: function() { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "copy"; if (this._action = t, "copy" !== this._action && "cut" !== this._action) throw new Error('Invalid "action" value, use either "copy" or "cut"') }, get: function() { return this._action } }, { key: "target", set: function(t) { if (void 0 !== t) { if (!t || "object" !== (void 0 === t ? "undefined" : r(t)) || 1 !== t.nodeType) throw new Error('Invalid "target" value, use a valid Element'); if ("copy" === this.action && t.hasAttribute("disabled")) throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute'); if ("cut" === this.action && (t.hasAttribute("readonly") || t.hasAttribute("disabled"))) throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes'); + this._target = t } }, get: function() { return this._target } }]), t }(); + t.exports = a }) }, function(t, e, n) { + function o(t, e, n) { if (!t && !e && !n) throw new Error("Missing required arguments"); if (!c.string(e)) throw new TypeError("Second argument must be a String"); if (!c.fn(n)) throw new TypeError("Third argument must be a Function"); if (c.node(t)) return r(t, e, n); if (c.nodeList(t)) return i(t, e, n); if (c.string(t)) return a(t, e, n); throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList") } + + function r(t, e, n) { return t.addEventListener(e, n), { destroy: function() { t.removeEventListener(e, n) } } } + + function i(t, e, n) { return Array.prototype.forEach.call(t, function(t) { t.addEventListener(e, n) }), { destroy: function() { Array.prototype.forEach.call(t, function(t) { t.removeEventListener(e, n) }) } } } + + function a(t, e, n) { return u(document.body, t, e, n) } var c = n(6), + u = n(5); + t.exports = o }, function(t, e) { + function n() {} + n.prototype = { on: function(t, e, n) { var o = this.e || (this.e = {}); return (o[t] || (o[t] = [])).push({ fn: e, ctx: n }), this }, once: function(t, e, n) { + function o() { r.off(t, o), e.apply(n, arguments) } var r = this; return o._ = e, this.on(t, o, n) }, emit: function(t) { var e = [].slice.call(arguments, 1), + n = ((this.e || (this.e = {}))[t] || []).slice(), + o = 0, + r = n.length; for (o; o < r; o++) n[o].fn.apply(n[o].ctx, e); return this }, off: function(t, e) { var n = this.e || (this.e = {}), + o = n[t], + r = []; if (o && e) + for (var i = 0, a = o.length; i < a; i++) o[i].fn !== e && o[i].fn._ !== e && r.push(o[i]); return r.length ? n[t] = r : delete n[t], this } }, t.exports = n }, function(t, e, n) { var o, r, i;! function(a, c) { r = [t, n(0), n(2), n(1)], o = c, void 0 !== (i = "function" == typeof o ? o.apply(e, r) : o) && (t.exports = i) }(0, function(t, e, n, o) { "use strict"; + + function r(t) { return t && t.__esModule ? t : { default: t } } + + function i(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function") } + + function a(t, e) { if (!t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return !e || "object" != typeof e && "function" != typeof e ? t : e } + + function c(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function, not " + typeof e); + t.prototype = Object.create(e && e.prototype, { constructor: { value: t, enumerable: !1, writable: !0, configurable: !0 } }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e) } + + function u(t, e) { var n = "data-clipboard-" + t; if (e.hasAttribute(n)) return e.getAttribute(n) } var l = r(e), + s = r(n), + f = r(o), + d = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) { return typeof t } : function(t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t }, + h = function() { + function t(t, e) { for (var n = 0; n < e.length; n++) { var o = e[n]; + o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o) } } return function(e, n, o) { return n && t(e.prototype, n), o && t(e, o), e } }(), + p = function(t) { + function e(t, n) { i(this, e); var o = a(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this)); return o.resolveOptions(n), o.listenClick(t), o } return c(e, t), h(e, [{ key: "resolveOptions", value: function() { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; + this.action = "function" == typeof t.action ? t.action : this.defaultAction, this.target = "function" == typeof t.target ? t.target : this.defaultTarget, this.text = "function" == typeof t.text ? t.text : this.defaultText, this.container = "object" === d(t.container) ? t.container : document.body } }, { key: "listenClick", value: function(t) { var e = this; + this.listener = (0, f.default)(t, "click", function(t) { return e.onClick(t) }) } }, { key: "onClick", value: function(t) { var e = t.delegateTarget || t.currentTarget; + this.clipboardAction && (this.clipboardAction = null), this.clipboardAction = new l.default({ action: this.action(e), target: this.target(e), text: this.text(e), container: this.container, trigger: e, emitter: this }) } }, { key: "defaultAction", value: function(t) { return u("action", t) } }, { key: "defaultTarget", value: function(t) { var e = u("target", t); if (e) return document.querySelector(e) } }, { key: "defaultText", value: function(t) { return u("text", t) } }, { key: "destroy", value: function() { this.listener.destroy(), this.clipboardAction && (this.clipboardAction.destroy(), this.clipboardAction = null) } }], [{ key: "isSupported", value: function() { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : ["copy", "cut"], + e = "string" == typeof t ? [t] : t, + n = !!document.queryCommandSupported; return e.forEach(function(t) { n = n && !!document.queryCommandSupported(t) }), n } }]), e }(s.default); + t.exports = p }) }, function(t, e) { + function n(t, e) { for (; t && t.nodeType !== o;) { if ("function" == typeof t.matches && t.matches(e)) return t; + t = t.parentNode } } var o = 9; if ("undefined" != typeof Element && !Element.prototype.matches) { var r = Element.prototype; + r.matches = r.matchesSelector || r.mozMatchesSelector || r.msMatchesSelector || r.oMatchesSelector || r.webkitMatchesSelector } + t.exports = n }, function(t, e, n) { + function o(t, e, n, o, r) { var a = i.apply(this, arguments); return t.addEventListener(n, a, r), { destroy: function() { t.removeEventListener(n, a, r) } } } + + function r(t, e, n, r, i) { return "function" == typeof t.addEventListener ? o.apply(null, arguments) : "function" == typeof n ? o.bind(null, document).apply(null, arguments) : ("string" == typeof t && (t = document.querySelectorAll(t)), Array.prototype.map.call(t, function(t) { return o(t, e, n, r, i) })) } + + function i(t, e, n, o) { return function(n) { n.delegateTarget = a(n.target, e), n.delegateTarget && o.call(t, n) } } var a = n(4); + t.exports = r }, function(t, e) { e.node = function(t) { return void 0 !== t && t instanceof HTMLElement && 1 === t.nodeType }, e.nodeList = function(t) { var n = Object.prototype.toString.call(t); return void 0 !== t && ("[object NodeList]" === n || "[object HTMLCollection]" === n) && "length" in t && (0 === t.length || e.node(t[0])) }, e.string = function(t) { return "string" == typeof t || t instanceof String }, e.fn = function(t) { return "[object Function]" === Object.prototype.toString.call(t) } }, function(t, e) { + function n(t) { var e; if ("SELECT" === t.nodeName) t.focus(), e = t.value; + else if ("INPUT" === t.nodeName || "TEXTAREA" === t.nodeName) { var n = t.hasAttribute("readonly"); + n || t.setAttribute("readonly", ""), t.select(), t.setSelectionRange(0, t.value.length), n || t.removeAttribute("readonly"), e = t.value } else { t.hasAttribute("contenteditable") && t.focus(); var o = window.getSelection(), + r = document.createRange(); + r.selectNodeContents(t), o.removeAllRanges(), o.addRange(r), e = o.toString() } return e } + t.exports = n }]) }); \ No newline at end of file diff --git a/json-formatter.js b/json-formatter.js index e2c3582..a7819c4 100644 --- a/json-formatter.js +++ b/json-formatter.js @@ -1,6 +1,6 @@ $(document).ready(function() { - formatJSON(); + //formatJSON(); }); diff --git a/panel.html b/panel.html index 2436b72..7c56391 100644 --- a/panel.html +++ b/panel.html @@ -11,6 +11,7 @@ + diff --git a/panel.js b/panel.js index 2c17db1..09b631a 100644 --- a/panel.js +++ b/panel.js @@ -123,7 +123,8 @@ chrome.runtime.onMessage.addListener( } }).done(function(result) { console.log(result); - $("body").prepend($("
" + JSON.stringify(result) + "
")) + $("body").prepend($("
" + JSON.stringify(result, undefined, 2) + "
")) + formatJSON(); }); From ae8dae06771873395920449866aa742d37a41441 Mon Sep 17 00:00:00 2001 From: Jon McLaren Date: Wed, 15 May 2019 15:40:37 -0500 Subject: [PATCH 32/47] fix javascript output --- panel.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/panel.js b/panel.js index 09b631a..539374d 100644 --- a/panel.js +++ b/panel.js @@ -17,6 +17,12 @@ var test = chrome.devtools.inspectedWindow.eval( ); console.log("test:",test); */ + +function safe_tags(str) { + return str.replace(/&/g, '&').replace(//g, '>'); +} + + function getUrlVars(url) { console.log("getting vars"); var vars = [], @@ -123,7 +129,7 @@ chrome.runtime.onMessage.addListener( } }).done(function(result) { console.log(result); - $("body").prepend($("
" + JSON.stringify(result, undefined, 2) + "
")) + $("body").prepend($("
" + safe_tags(JSON.stringify(result, undefined, 2)) + "
")) formatJSON(); }); From 8ed1f690d29f313955fc3aefb6225b2ec6680790 Mon Sep 17 00:00:00 2001 From: Jon McLaren Date: Wed, 15 May 2019 15:48:18 -0500 Subject: [PATCH 33/47] fix formatting --- panel.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/panel.js b/panel.js index 539374d..4d94d2e 100644 --- a/panel.js +++ b/panel.js @@ -131,6 +131,12 @@ chrome.runtime.onMessage.addListener( console.log(result); $("body").prepend($("
" + safe_tags(JSON.stringify(result, undefined, 2)) + "
")) formatJSON(); + + // TODO we should be able to load the css a different way in panels, we'll need to look into that + $.get(chrome.extension.getURL('/json-formatter.css'), function(data) { + $("body").prepend(""); + }); + }); From 43be943f2ca5db295582550cf6e4aade8818a6a2 Mon Sep 17 00:00:00 2001 From: Jon McLaren Date: Wed, 15 May 2019 17:25:25 -0500 Subject: [PATCH 34/47] dynamic grabbing of domain name and path --- hsInspector.js | 16 ++++++++-------- panel.js | 8 ++++++-- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/hsInspector.js b/hsInspector.js index 6f7efa3..b6bdbb5 100644 --- a/hsInspector.js +++ b/hsInspector.js @@ -2,18 +2,18 @@ console.log("hsinspector js loaded!"); var devInfoLinks = document.querySelectorAll(".hs-tools-menu a"); -devInfoLinks.forEach(function(el,i){ +devInfoLinks.forEach(function(el, i) { var linkURL = el.getAttribute("href"); var linkText = el.textContent; - if (linkText.includes("Developer Info")){ - console.log(linkText,linkURL); - chrome.runtime.sendMessage({devInfoURL: linkURL}, function(response) { + if (linkText.includes("Developer Info")) { + console.log(linkText, linkURL); + chrome.runtime.sendMessage({ devInfoURL: linkURL }, function(response) { console.log(response.farewell); - }); + }); } - - - + + + }); diff --git a/panel.js b/panel.js index 4d94d2e..e029ccf 100644 --- a/panel.js +++ b/panel.js @@ -91,6 +91,10 @@ chrome.runtime.onMessage.addListener( console.log("PORTAL ID:", devInfoData.portalId); var portalId = devInfoData.portalId; + console.log(sender.tab.url); + const inspectedURL = new URL(sender.tab.url); + console.log(inspectedURL.hostname); + console.log(inspectedURL.pathname); console.log("getting Token"); jQuery.ajax({ @@ -120,10 +124,10 @@ chrome.runtime.onMessage.addListener( parser = document.createElement('a'); //not sure what in the world this is for, maybe incase auto redirect fails? parser.href = url; var accessToken = currentToken; - var currentDomain = "centrisys-4299619.hs-sites.com"; + var currentDomain = inspectedURL.hostname; $.ajax({ //url: 'https://' + apiHost + '/content/api/v4/domains/by-domain?portalId=' + portalId + '&domain=' + parser.hostname + '&access_token=' + accessToken, - url: 'https://' + currentDomain + '/__context__/?portalId=' + portalId + '&access_token=' + accessToken, + url: 'https://' + currentDomain + '/__context__/' + inspectedURL.pathname + '?portalId=' + portalId + '&access_token=' + accessToken, xhrFields: { withCredentials: true } From 8dce562adb95d35727506a0889ff9a73eb529bee Mon Sep 17 00:00:00 2001 From: Jon McLaren Date: Wed, 15 May 2019 21:29:18 -0500 Subject: [PATCH 35/47] made it so if tabs permission granted you no longer need to press the button. --- panel.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/panel.js b/panel.js index e029ccf..abfb01c 100644 --- a/panel.js +++ b/panel.js @@ -43,6 +43,23 @@ function getParameterByName(name) { return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); } +chrome.permissions.contains({ + permissions: ['tabs'], + origins: [''] +}, function(result) { + if (result) { + $("#load").remove(); + console.log("Perm granted"); + /*inject hsinspector*/ + chrome.tabs.executeScript(chrome.devtools.inspectedWindow.tabId, { + file: "hsInspector.js" + }); + + + } else { + // The extension doesn't have the permissions. + } +}); From 11d00a1378fe0d110a0082f3d79cdf5202828c49 Mon Sep 17 00:00:00 2001 From: Jon McLaren Date: Wed, 15 May 2019 21:35:42 -0500 Subject: [PATCH 36/47] disable collapsing full json, also tweaked font sizes and line-heights to condense --- json-formatter.css | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/json-formatter.css b/json-formatter.css index a6716f4..0bc4a4a 100644 --- a/json-formatter.css +++ b/json-formatter.css @@ -2,10 +2,10 @@ .json-formatted { white-space: pre; - line-height: 1.3em; + line-height: 1; font-size: 17px; padding: 0 1rem; - font-size: 17px; + font-size: 12px; color: #eaf0f6; background: linear-gradient(45deg, #33475b, #2d3e50); } @@ -90,6 +90,13 @@ white-space: nowrap; } + +/* disable ability to collapse entire json array, performance wise it's sluggish, also kinda pointless.*/ + +ul.array>li.minimize-me { + display: none!important; +} + .json-formatted .minimize-me:not(:last-child) { position: absolute; display: inline-block; From 5c19dd7a04d3c0a63fc2c272c870b0c028aff6a2 Mon Sep 17 00:00:00 2001 From: Jon McLaren Date: Wed, 15 May 2019 21:44:32 -0500 Subject: [PATCH 37/47] further reducing padding to minimize space that it occupies --- json-formatter.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/json-formatter.css b/json-formatter.css index 0bc4a4a..40b395c 100644 --- a/json-formatter.css +++ b/json-formatter.css @@ -62,7 +62,7 @@ .json-formatted .array, .json-formatted .list { - padding: 0 0 0 2.5rem; + padding: 0 0 0 0; margin: 0; margin-top: .2em; list-style: none; From b96c26a61a0ac048a69a35f6e9eb49d5d9ac0bbd Mon Sep 17 00:00:00 2001 From: Jon McLaren Date: Wed, 15 May 2019 22:03:02 -0500 Subject: [PATCH 38/47] Add initial explanation message --- panel.html | 8 +++++++- panel.js | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/panel.html b/panel.html index 7c56391..d610b77 100644 --- a/panel.html +++ b/panel.html @@ -6,7 +6,13 @@ - +
+

Developer Info

+

This feature is in testing, and in-fact is expected to stop working around May 23rd due to a HubSpot change. This feature pulls the developer info for the current HubSpot page, formats it into human readable form, with collapsable sections and + quick-copy functionality. Simply click on the key name and it will copy the HubL required to get that variable, click on the value itself to simply copy the current value.

+

This feature requires a special chrome permission

+

Currently this feature requires the a chrome permission that gives the extension access to your basic tab information. No data of yours is stored nor transmitted anywhere. Our Privacy Policy explains in detail how data is handled.

+
diff --git a/panel.js b/panel.js index abfb01c..a231dbd 100644 --- a/panel.js +++ b/panel.js @@ -54,7 +54,7 @@ chrome.permissions.contains({ chrome.tabs.executeScript(chrome.devtools.inspectedWindow.tabId, { file: "hsInspector.js" }); - + $(".explanation").remove(); } else { // The extension doesn't have the permissions. @@ -77,6 +77,7 @@ document.querySelector('#load').addEventListener('click', function(event) { chrome.tabs.executeScript(chrome.devtools.inspectedWindow.tabId, { file: "hsInspector.js" }); + $(".explanation").remove(); } else { From a721119b60d8ab31679f8ffecaca940bb5bc6cf1 Mon Sep 17 00:00:00 2001 From: Jon McLaren Date: Wed, 15 May 2019 22:11:08 -0500 Subject: [PATCH 39/47] fixing padding --- json-formatter.css | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/json-formatter.css b/json-formatter.css index 40b395c..8fb67e4 100644 --- a/json-formatter.css +++ b/json-formatter.css @@ -62,7 +62,7 @@ .json-formatted .array, .json-formatted .list { - padding: 0 0 0 0; + padding: 0 0 0 2.5rem; margin: 0; margin-top: .2em; list-style: none; @@ -93,7 +93,11 @@ /* disable ability to collapse entire json array, performance wise it's sluggish, also kinda pointless.*/ -ul.array>li.minimize-me { +body>ul.array { + padding-left: 0; +} + +body>ul.array>li.minimize-me { display: none!important; } From 4fbe78f08bf0438713e9b76b0d77d756e7b52094 Mon Sep 17 00:00:00 2001 From: Jon McLaren Date: Wed, 15 May 2019 22:15:31 -0500 Subject: [PATCH 40/47] increased specificity in css selector added target to link --- json-formatter.css | 2 +- panel.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/json-formatter.css b/json-formatter.css index 8fb67e4..0355dea 100644 --- a/json-formatter.css +++ b/json-formatter.css @@ -93,7 +93,7 @@ /* disable ability to collapse entire json array, performance wise it's sluggish, also kinda pointless.*/ -body>ul.array { +body.json-formatted>ul.array { padding-left: 0; } diff --git a/panel.html b/panel.html index d610b77..862cb8b 100644 --- a/panel.html +++ b/panel.html @@ -11,7 +11,7 @@

Developer Info

This feature is in testing, and in-fact is expected to stop working around May 23rd due to a HubSpot change. This feature pulls the developer info for the current HubSpot page, formats it into human readable form, with collapsable sections and quick-copy functionality. Simply click on the key name and it will copy the HubL required to get that variable, click on the value itself to simply copy the current value.

This feature requires a special chrome permission

-

Currently this feature requires the a chrome permission that gives the extension access to your basic tab information. No data of yours is stored nor transmitted anywhere. Our Privacy Policy explains in detail how data is handled.

+

Currently this feature requires the a chrome permission that gives the extension access to your basic tab information. No data of yours is stored nor transmitted anywhere. Our Privacy Policy explains in detail how data is handled.

From c3fdae785b85e1ecb063d95bcf33b33a7d9bd2e2 Mon Sep 17 00:00:00 2001 From: Jon McLaren Date: Wed, 15 May 2019 22:46:58 -0500 Subject: [PATCH 41/47] increment ver # --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 2b0d646..318409a 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 2, "name": "__MSG_extName__", - "version": "1.04.7", + "version": "1.05", "default_locale": "en", "description": "__MSG_extDesc__", "browser_action": { From 2b3110595aa865c95fd037540c1a6ba3b4384b0d Mon Sep 17 00:00:00 2001 From: Jon McLaren Date: Wed, 15 May 2019 22:55:30 -0500 Subject: [PATCH 42/47] increment version number --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 318409a..5a00ff5 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 2, "name": "__MSG_extName__", - "version": "1.05", + "version": "1.05.01", "default_locale": "en", "description": "__MSG_extDesc__", "browser_action": { From a50b29c4734f4ed6a7bb055ba218fbfa971b6cf1 Mon Sep 17 00:00:00 2001 From: Jon McLaren Date: Fri, 17 May 2019 12:08:13 -0500 Subject: [PATCH 43/47] disabled developer info feature. Added text explaining the plan. --- panel.html | 17 ++++++++++++----- panel.js | 11 ++++++----- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/panel.html b/panel.html index 862cb8b..5218939 100644 --- a/panel.html +++ b/panel.html @@ -6,14 +6,21 @@ -
-

Developer Info

-

This feature is in testing, and in-fact is expected to stop working around May 23rd due to a HubSpot change. This feature pulls the developer info for the current HubSpot page, formats it into human readable form, with collapsable sections and +

+

Developer Info

+

Stay Tuned! We are working with HubSpot to find a way to securely pull in the developer info, after a change on HubSpot's end, disables our ability to pull it.

+

If/when we get this feature working we will be able to explore doing a lot more powerful things for you as developers. Some possible examples of interesting things might be:

+
    +
  • Displaying modules that are in flex columns with quick access to their field data.
  • +
  • Highlighting field data being outputted in modules
  • +
  • Have a nice UI that lets you get at the specific developer info you want, in a more friendly format than a gigantic json array.
  • +
+
- + diff --git a/panel.js b/panel.js index a231dbd..179b7c0 100644 --- a/panel.js +++ b/panel.js @@ -42,7 +42,7 @@ function getParameterByName(name) { results = regex.exec(location.search); return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); } - +/* chrome.permissions.contains({ permissions: ['tabs'], origins: [''] @@ -50,7 +50,7 @@ chrome.permissions.contains({ if (result) { $("#load").remove(); console.log("Perm granted"); - /*inject hsinspector*/ + // inject hsinspector chrome.tabs.executeScript(chrome.devtools.inspectedWindow.tabId, { file: "hsInspector.js" }); @@ -73,7 +73,7 @@ document.querySelector('#load').addEventListener('click', function(event) { // The callback argument will be true if the user granted the permissions. if (granted) { console.log("Perm granted"); - /*inject hsinspector*/ + //inject hsinspector chrome.tabs.executeScript(chrome.devtools.inspectedWindow.tabId, { file: "hsInspector.js" }); @@ -82,7 +82,7 @@ document.querySelector('#load').addEventListener('click', function(event) { } else { console.log("Perm denied"); - /*should display a message - cannot show dev info without permission */ + //should display a message - cannot show dev info without permission } }); }); @@ -167,4 +167,5 @@ chrome.runtime.onMessage.addListener( } } -); \ No newline at end of file +); +*/ \ No newline at end of file From bb52c77d50f481c854b43a2b0b5ba334620730ea Mon Sep 17 00:00:00 2001 From: Jon McLaren Date: Mon, 20 May 2019 19:12:00 -0500 Subject: [PATCH 44/47] update panel text --- panel.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panel.html b/panel.html index 5218939..eb10938 100644 --- a/panel.html +++ b/panel.html @@ -8,7 +8,7 @@

Developer Info

-

Stay Tuned! We are working with HubSpot to find a way to securely pull in the developer info, after a change on HubSpot's end, disables our ability to pull it.

+

Stay Tuned! We are working with HubSpot to find a way to securely pull in the developer info, a change on HubSpot's end disables our ability to pull it.

If/when we get this feature working we will be able to explore doing a lot more powerful things for you as developers. Some possible examples of interesting things might be:

  • Displaying modules that are in flex columns with quick access to their field data.
  • From 1499c1933bd309b00a9346d98225225410be5299 Mon Sep 17 00:00:00 2001 From: Jon McLaren Date: Mon, 20 May 2019 19:13:32 -0500 Subject: [PATCH 45/47] increment version number --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 01feb9e..94cf3eb 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 2, "name": "__MSG_extName__", - "version": "1.05.01", + "version": "1.05.02", "default_locale": "en", "description": "__MSG_extDesc__", "browser_action": { From 9841d6235ab9d02982e99389022d2a2859f6f3e9 Mon Sep 17 00:00:00 2001 From: Jon McLaren Date: Mon, 20 May 2019 19:13:51 -0500 Subject: [PATCH 46/47] remove excess space --- manifest.json | 1 - 1 file changed, 1 deletion(-) diff --git a/manifest.json b/manifest.json index 94cf3eb..6f61aaa 100644 --- a/manifest.json +++ b/manifest.json @@ -29,7 +29,6 @@ "optional_permissions": [ "https://app.hubspot.com/*", "https://app.hubspotqa.com/*", - "tabs", "" ], From 85aa3eb5406bf359fa351d704ff5cab02cf32a70 Mon Sep 17 00:00:00 2001 From: Jon McLaren Date: Mon, 20 May 2019 21:47:59 -0500 Subject: [PATCH 47/47] remove optional permissions tabs and all_urls --- manifest.json | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/manifest.json b/manifest.json index 6f61aaa..4991245 100644 --- a/manifest.json +++ b/manifest.json @@ -28,9 +28,7 @@ ], "optional_permissions": [ "https://app.hubspot.com/*", - "https://app.hubspotqa.com/*", - "tabs", - "" + "https://app.hubspotqa.com/*" ], "web_accessible_resources": [ "mac-text-cursor.svg",