-
Notifications
You must be signed in to change notification settings - Fork 1
/
session-store-rescore.html
100 lines (98 loc) · 4.96 KB
/
session-store-rescore.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Add Scores to Publisher Entries</title>
<style>
body {
max-width: 640px;
margin: auto auto;
font-family: Verdana;
}
h1 {
font-weight: normal;
}
p, ul {
line-height: 150%
}
img {
max-width: 100%;
display: block;
margin: auto auto;
}
p.warning {
text-align: center;
font-weight: bold;
border: 1px solid black;
padding: 1em;
}
p.update {
font-weight: bold;
text-align: center;
padding: 1em;
box-shadow: 0 5px 10px #CCC;
background: #f1f1f1;
}
</style>
</head>
<body>
<p class="update">As of version <a href="https://github.com/brave/browser-laptop/releases/tag/v0.21.24dev">0.21.24 of Brave</a>, this page is no longer needed.</p>
<h1>Does your browser look like this?</h1>
<img src="session-store-rescore/browser.png">
<p>If your browser has opened in the above state (see <a href='https://github.com/brave/browser-laptop/issues/13488'>this issue</a>), this page may be able to help you.</p>
<p>Before you begin, please ensure that all Brave windows are closed.</p>
<p>First, we'll need to locate the <code>session-store-1</code> file on your machine. This file helps Brave remember what your workspace looked like before closing. It will create, position, size, and setup your browser windows.</p>
<p>The <code>session-store-1</code> location depends on your operating system:</p>
<ul>
<li>Windows: <code>%appdata%/brave/session-store-1</code> [<a href="#help-windows">help</a>]</li>
<li>macOS: <code>~/Library/Application\ Support/brave/session-store-1</code> [<a href="#help-macos">help</a>]</li>
</ul>
<p>Once you've located that file, drag and drop it onto this page. A replacement file will be downloaded automatically.</p>
<p><strong>IMPORTANT:</strong> macOS users may see <code>session-store-1.json</code> downloaded. If this is the case, you should rename the file to <code>session-store-1</code>. You can do this via Terminal:</p>
<p>
<code>cd ~/Library/Application\ Support/brave<br>
mv session-store-1.json session-store-1</code>
</p>
<p class="warning">DO NOT REPLACE WITHOUT FIRST CREATING A BACKUP</p>
<p>Once you've secured your backup, you can place this new file in the location of the original. Next, start Brave!</p>
<h2>Additional Help</h2>
<p><strong>Windows Users</strong></p>
<p id="help-windows">To locate the <code>session-store-1</code> file on Windows, press WinKey+R and type <em>%appdata%/brave</em> into the window.</p>
<p><img src="session-store-rescore/win-run.png"></p>
<p><strong>macOS Users</strong></p>
<p id="help-macos">To locate the <code>session-store-1</code> file on macOS, pres CMD+Spacebar and type <em>Terminal</em> into the input.</p>
<p><img src="session-store-rescore/macos-terminal.png"></p>
<p>From within the terminal, run the following command:</p>
<p><code>open ~/Library/Application\ Support/brave</code></p>
<p><img src="session-store-rescore/macos-terminal2.png"></p>
<p>Once you press enter, and run that command, you should see a Finder window pointing to the Brave directory. Within this directory is the <code>session-store-1</code> file.</p>
<script>
function invokeDownload (contents) {
var a = document.createElement('a')
a.download = 'session-store-1'
a.href = URL.createObjectURL(new Blob([contents], {type: 'application/x-unknown'}))
document.body.appendChild(a)
a.click()
}
document.addEventListener('dragover', function (e) {
e.preventDefault()
})
document.addEventListener('drop', function (e) {
e.preventDefault();
var file = e.dataTransfer.files.item(0)
if (file.name === "session-store-1") {
var reader = new FileReader()
reader.addEventListener('load', function (data) {
var entry, state = JSON.parse(reader.result)
var publishers = state.ledger.synopsis.publishers
for (entry in publishers) {
publishers[entry].scores = publishers[entry].scores || {}
}
invokeDownload(JSON.stringify(state))
})
reader.readAsText(file)
}
})
</script>
</body>
</html>