feat(extension): (theoretical) compatibility with google chrome
Some checks failed
Build extension ZIP / Build extension (push) Failing after 26s
Some checks failed
Build extension ZIP / Build extension (push) Failing after 26s
This commit is contained in:
parent
9400db5a9c
commit
760c204f27
3 changed files with 10 additions and 10 deletions
|
@ -95,9 +95,9 @@ function handleMessage(message, sender) {
|
|||
} else if (message['type'] === 'create-popup') {
|
||||
const create = message['create'];
|
||||
create.url += '&tabId=' + sender.tab.id;
|
||||
browser.windows.create(create);
|
||||
chrome.windows.create(create);
|
||||
} else if (message['type'] === 'autofill-code') {
|
||||
browser.tabs.sendMessage(message['tabId'], {
|
||||
chrome.tabs.sendMessage(message['tabId'], {
|
||||
type: 'autofill-code',
|
||||
code: message['code'],
|
||||
});
|
||||
|
@ -106,11 +106,11 @@ function handleMessage(message, sender) {
|
|||
}
|
||||
}
|
||||
|
||||
browser.webRequest.onBeforeRequest.addListener(interceptCode, {
|
||||
chrome.webRequest.onBeforeRequest.addListener(interceptCode, {
|
||||
urls: ['https://checkin.york.ac.uk/api/selfregistration/*/present'],
|
||||
}, ['requestBody']);
|
||||
browser.webRequest.onCompleted.addListener(interceptSubmit, {
|
||||
chrome.webRequest.onCompleted.addListener(interceptSubmit, {
|
||||
urls: ['https://checkin.york.ac.uk/api/selfregistration/*/present'],
|
||||
});
|
||||
|
||||
browser.runtime.onMessage.addListener(handleMessage)
|
||||
chrome.runtime.onMessage.addListener(handleMessage)
|
||||
|
|
|
@ -9,7 +9,7 @@ console.log('hello');
|
|||
const name = section.querySelector('.row:nth-child(2) > .col-md-4').innerText;
|
||||
const space = section.querySelector('.row:nth-child(4) > .col-md-4').innerText;
|
||||
|
||||
browser.runtime.sendMessage({
|
||||
chrome.runtime.sendMessage({
|
||||
type: 'link-activity-details',
|
||||
activityId,
|
||||
date,
|
||||
|
@ -26,10 +26,10 @@ console.log('hello');
|
|||
activity: name,
|
||||
space,
|
||||
});
|
||||
browser.runtime.sendMessage({
|
||||
chrome.runtime.sendMessage({
|
||||
type: 'create-popup',
|
||||
create: {
|
||||
url: browser.runtime.getURL('src/popup.html') + '#' + params.toString(),
|
||||
url: chrome.runtime.getURL('src/popup.html') + '#' + params.toString(),
|
||||
width: 360,
|
||||
height: 480,
|
||||
type: 'popup',
|
||||
|
@ -54,4 +54,4 @@ function handleMessage(message) {
|
|||
}
|
||||
}
|
||||
|
||||
browser.runtime.onMessage.addListener(handleMessage);
|
||||
chrome.runtime.onMessage.addListener(handleMessage);
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
window.close();
|
||||
}, 'warning');
|
||||
const submitButton = simpleButton(`Autofill ${code}`, function () {
|
||||
browser.runtime.sendMessage({
|
||||
chrome.runtime.sendMessage({
|
||||
type: 'autofill-code',
|
||||
code,
|
||||
tabId,
|
||||
|
|
Loading…
Reference in a new issue