mirror of
https://github.com/wallabag/wallabag.git
synced 2025-07-27 17:28:39 +00:00
Send postMessage to opener before autoclose
This commit is contained in:
parent
7d6bd5670e
commit
a7991b2d4c
1 changed files with 11 additions and 2 deletions
|
@ -1,6 +1,15 @@
|
|||
$(document).ready(function() {
|
||||
current_url = window.location.href
|
||||
if (current_url.match("&closewin=true")) {
|
||||
if (location.search.match("&closewin=true")) {
|
||||
if (window.opener) {
|
||||
var msgDiv = $("div.messages");
|
||||
var msg = msgDiv.children("p").text();
|
||||
var status = msgDiv.hasClass("success") ?
|
||||
'success' : 'unknown';
|
||||
var url = $(".tool.link")[0].href;
|
||||
window.opener.postMessage({"wallabag-status": status,
|
||||
"wallabag-msg": msg,
|
||||
"wallabag-url": url }, "*");
|
||||
}
|
||||
window.close();
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue