Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: background.js

Issue 29829611: Issue 6786 - Display the Safari App Extension migration page (Closed)
Patch Set: Created July 13, 2018, 5:36 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | safari/ext/background.js » ('j') | safari/ext/background.js » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-present eyeo GmbH 3 * Copyright (C) 2006-present eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 targetPage = sender.page; 55 targetPage = sender.page;
56 56
57 if (targetPage) 57 if (targetPage)
58 { 58 {
59 msg.payload.sender = sender.page.id; 59 msg.payload.sender = sender.page.id;
60 if (msg.expectsResponse) 60 if (msg.expectsResponse)
61 return new Promise(targetPage.sendMessage.bind(targetPage, msg.payload)); 61 return new Promise(targetPage.sendMessage.bind(targetPage, msg.payload));
62 targetPage.sendMessage(msg.payload); 62 targetPage.sendMessage(msg.payload);
63 } 63 }
64 }); 64 });
65
66 // Display a page to explain to users of Safari 10 and higher that they need
67 // to migrate to our Safari App extension, but only once the migration page
68 // is online.
69
70 function showMigrationPageWhenReady()
71 {
72 fetch("https://eyeo.to/adblockplus/safari-app-extension-migration")
Sebastian Noack 2018/07/13 18:01:35 I wonder, should we perhaps just send a HEAD reque
kzar 2018/07/13 18:44:04 Done.
73 .then(function(response)
74 {
75 if (response.ok)
76 ext.showPage(response.url);
77 });
78 }
79
80 if (Services.vc.compare(require("info").applicationVersion, "10") >= 0)
81 {
82 // Show now, and then once every 24 hours.
83 showMigrationPageWhenReady();
84 window.setInterval(showMigrationPageWhenReady, 1000 * 60 * 60 * 24);
Sebastian Noack 2018/07/13 18:01:35 As far as I understand the issue description, we o
kzar 2018/07/13 18:44:04 I've adjusted the issue description to clarify.
85 }
OLDNEW
« no previous file with comments | « no previous file | safari/ext/background.js » ('j') | safari/ext/background.js » ('J')

Powered by Google App Engine
This is Rietveld