This repository has been archived by the owner on Nov 6, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master'
- Loading branch information
Showing
9 changed files
with
329 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<head> | ||
<title></title> | ||
<script src="devtools-panel.js"></script> | ||
</head> | ||
<body> | ||
<div id=SwitchPlanner> | ||
<input type=checkbox id=SwitchPlannerCheckbox> | ||
<label for=SwitchPlannerCheckbox>Enable HTTPS Switch Planner mode (reloads page).</label> | ||
<p> | ||
<div id=SwitchPlannerDescription> | ||
Switch Planner mode helps prepare for your site's switch to HTTPS by generating | ||
a report of external HTTP resources that might not yet be available on HTTPS. | ||
<p> | ||
After enabling, navigate around your site and try to exercise all | ||
functionality in order to get a comprehensive list of external resources. | ||
<p> | ||
For each group of resources listed as "Unrewritten," find out whether they | ||
are available on HTTPS. If so: add a rule to HTTPS Everywhere! If not: try | ||
to make them available over HTTPS or use a different resource or provider. | ||
Otherwise your site will generate | ||
<a id=MixedContentLink href="https://developer.mozilla.org/en-US/docs/Security/MixedContent#Mixed_passive.2Fdisplay_content">Mixed Content</a> | ||
(passive or active) errors when you turn on HTTPS. | ||
<p> | ||
For most accurate results, disable ad blockers before using. Closing this | ||
panel will deactivate Switch Planner mode and clear stored data. | ||
</div> | ||
<div id=SwitchPlannerResults style="display: none;"> | ||
<div id=SwitchPlannerDetails></div> | ||
<a id=SwitchPlannerDetailsLink href="javascript:void(0);">details</a> | ||
</div> | ||
</div> | ||
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
function e(id) { | ||
return document.getElementById(id); | ||
} | ||
|
||
function sendMessage(type) { | ||
chrome.runtime.sendMessage({ | ||
type: type, | ||
tabId: chrome.devtools.inspectedWindow.tabId, | ||
}); | ||
} | ||
|
||
// Turn on the Switch Planner recording mode, and hide the long description. | ||
function enableSwitchPlanner() { | ||
sendMessage("enable"); | ||
e("SwitchPlannerDescription").style.display = "none"; | ||
e("SwitchPlannerDetails").style.display = "block"; | ||
// Hack: Fetch and display summary information from background page | ||
// once per second. | ||
setInterval(display, 1000); | ||
chrome.devtools.inspectedWindow.reload(); | ||
} | ||
|
||
// Disable the switch planner and reload, so any state is forgotten and | ||
// the long description is restored. | ||
function disableSwitchPlanner() { | ||
sendMessage("disable"); | ||
document.location.reload(); | ||
} | ||
|
||
// Fetch summary HTML of the planner results from the background page for | ||
// display in the devtools panel. | ||
function display() { | ||
chrome.runtime.sendMessage({ | ||
type: "getSmallHtml", | ||
tabId: chrome.devtools.inspectedWindow.tabId, | ||
}, function(response) { | ||
e("SwitchPlannerDetails").innerHTML = response.html; | ||
e("SwitchPlannerResults").style.display = "block"; | ||
}); | ||
} | ||
|
||
window.onload = function() { | ||
// Open a connection to the background page. Right now this is only used | ||
// by the background page so it knows when the devtools pane has closed. | ||
// We don't receive messages from the background page currently, though that | ||
// may be a future improvement. Sending messages to the background page doesn't | ||
// require an existing connection. | ||
chrome.runtime.connect({ name: "devtools-page" }); | ||
|
||
var checkbox = e("SwitchPlannerCheckbox"); | ||
checkbox.addEventListener("change", function() { | ||
if (checkbox.checked) { | ||
enableSwitchPlanner(); | ||
} else { | ||
disableSwitchPlanner(); | ||
} | ||
}); | ||
|
||
e("SwitchPlannerDetailsLink").addEventListener("click", function() { | ||
window.open("switch-planner.html?tab=" + chrome.devtools.inspectedWindow.tabId); | ||
}); | ||
// Since this is rendered in a devtools console, we have to make clicks on the | ||
// link open a new window. | ||
e("MixedContentLink").addEventListener("click", function(e) { | ||
window.open(e.target.href); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<head> | ||
<title></title> | ||
<script src="devtools.js"></script> | ||
</head> | ||
<body> | ||
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
chrome.devtools.panels.create("HTTPS Everywhere", | ||
"icon48.png", | ||
"devtools-panel.html", | ||
function(panel) { | ||
} | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<head> | ||
<title></title> | ||
<script src="switch-planner.js"></script> | ||
</head> | ||
<body> | ||
<div id=content /> | ||
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
window.onload = function() { | ||
var backgroundPage = chrome.extension.getBackgroundPage(); | ||
var tab = document.location.search.match(/tab=([^&]*)/)[1]; | ||
document.getElementById("content").innerHTML = | ||
backgroundPage.switchPlannerDetailsHtml(tab); | ||
}; | ||
|