Skip to content

Commit 68b233a

Browse files
committed
Stop sending plain text source of the page
A plain text representation doesn't make much sense.
1 parent 93d676b commit 68b233a

File tree

4 files changed

+4
-11
lines changed

4 files changed

+4
-11
lines changed

README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ following components:
5353
1. The browser extension (add-on).
5454
2. The host application.
5555
3. A configuration file.
56-
4. Scripts, or bertter to say executables, *you* write to do anything *you* like
56+
4. Scripts, or better to say executables, *you* write to do anything *you* like
5757
with URLs and pages received from the browser.
5858

5959
The extension does nothing more than provides a human-friendly interface to
@@ -65,7 +65,6 @@ access to following environment variables provided by the host:
6565

6666
- `Q_PAGE_URL`, a URL of the page
6767
- `Q_PAGE_HTML`, a path to temporary file containing source code of the page
68-
- `Q_PAGE_TEXT`, a path to a temporary file containing only text of the page
6968

7069
You define all available commands in a configuration file. See the
7170
configuration section below for all details.

extension/src/background.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,9 @@ class RPCServer {
5252
message.params[1] !== undefined ? message.params[1].url : null;
5353
const pageHTML =
5454
message.params[1] !== undefined ? message.params[1].html : null;
55-
const pageText =
56-
message.params[1] !== undefined ? message.params[1].text : null;
5755

5856
rpcRequest.method = "RunCommand";
59-
rpcRequest.params = [commandID, pageURL, pageHTML, pageText];
57+
rpcRequest.params = [commandID, pageURL, pageHTML];
6058

6159
const onSuccess = function (response) {
6260
console.debug("RPCServer#onMessage/onSuccess");

extension/src/content.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
window.context = {
22
url: window.document.documentURI,
3-
html: window.document.documentElement.innerHTML,
4-
text: window.document.documentElement.innerText,
3+
html: window.document.documentElement.innerHTML
54
};
6-
7-
// window.context

extension/src/popup.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ class ViewModel {
107107

108108
runCommand(commandID) {
109109
const callback = function (response) {
110-
console.debug(response);
111110
this.#coordinatorDelegate.viewModelDidFinish();
112111
}.bind(this);
113112

@@ -128,7 +127,7 @@ class Model {
128127
});
129128
this.#connection.onMessage.addListener(this.#onMessage.bind(this));
130129

131-
// Fetch page context (URL, HTML, text).
130+
// Fetch page context (URL and HTML).
132131
const executing = browser.tabs.executeScript({
133132
file: "content.js",
134133
});

0 commit comments

Comments
 (0)