Project

General

Profile

« Previous | Next » 

Revision 003876d5

Added by koszko over 1 year ago

present appropriate error message when using popup in Private Browsing mode

View differences:

html/repo_query.js
160 160

  
161 161
const container_ids = ["repos_list_container", "install_view_container"];
162 162

  
163
function RepoQueryView(tab_id, on_view_show, on_view_hide) {
163
function RepoQueryView(tab, on_view_show, on_view_hide) {
164 164
    Showable.call(this, on_view_show, on_view_hide);
165 165

  
166 166
    Object.assign(this, clone_template("repo_query"));
167
    this.tab_id = tab_id;
167
    this.tab_id = tab.id;
168
#IF MOZILLA
169
    this.incognito = tab.incognito;
170
    if (this.incognito) {
171
	[...this.top_text.childNodes].forEach(n => n.remove());
172
	this.top_text.append(
173
	    clone_template("repo_query_private_mode_error").main_span
174
	);
175
    }
176
#ENDIF
168 177

  
169 178
    const show_container = name => {
170 179
	for (const cid of container_ids) {
......
175 184
    }
176 185

  
177 186
    this.install_view = new InstallView(
178
	tab_id,
187
	this.tab_id,
179 188
	() => show_container("install_view_container"),
180 189
	() => show_container("repos_list_container")
181 190
    );
......
186 195
	if (!show_super())
187 196
	    return;
188 197

  
198
#IF MOZILLA
199
	if (this.incognito) {
200
	    this.repo_entries = [];
201
	    return;
202
	}
203
#ENDIF
204

  
189 205
	this.url = url;
190 206
	this.url_span.innerText = url;
191 207

  

Also available in: Unified diff