Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function checkIfNewContent()
- {
- fetch(RssUrl).then((res) => {
- res.text().then((plainxml) => {
- var domParser = new DOMParser();
- var xmlParsed = domParser.parseFromString(plainxml, 'text/xml');
- var lastBuildDate = xmlParsed.querySelectorAll('lastBuildDate')[0].textContent;
- chrome.storage.local.get('lastbuild', function (result) {
- if (result.lastbuild != lastBuildDate)
- {
- chrome.storage.local.set({ 'lastbuild': lastBuildDate }, function () {
- chrome.browserAction.setBadgeText({ text: 'News' });
- chrome.browserAction.setBadgeBackgroundColor({ color: [255, 0, 0, 255] });
- });
- }
- });
- })
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement