arunelias / session-alive

Session Alive
MIT License
101 stars 12 forks source link

Background URI matching on initalisation #22

Open fatdunky opened 3 years ago

fatdunky commented 3 years ago

Hi,

I have been trying to get session-alive working with outlook webmail.

What i have found is, the rules work when using "Add a Rule for the page". But then when opening a new tab or reopening the browser etc the rule is not applied.

The issue appears to be that outlook adds alot onto the end of its URL etc.

So in background.js when you match the URI (line 234), you do an exact match:

if (bg_triggerUriVal !== "" && bg_triggerUriVal.replace(/\/$/, '').toLowerCase() == uri) {

From debugging i can see the following values: ​

bg_triggerUriVal: "https://outlook.office.com/"
uri: "https://outlook.office.com/mail/inbox/id/aaqkagm2ytq1lti3mjet

Are we able to update the match to an indexOf? (the same as foreground matches?) or add an option into setting to enable indexOf matching?

if (fg_loopUriVal !== "" && uri.length >= fg_loopUriVal.length && uri.indexOf(fg_loopUriVal) === 0) {

Lanchon commented 3 years ago

see #18.

also, URL matching should always be case sensitive.

arunelias commented 2 years ago

Hi @fatdunky Thank you for your feedback I have committed the Trigger URL with wildcards feature with version 2.2 You can use Trigger URL (Background rule) as https://outlook.office.com/* Please test and provide feedback I will test this and publish to Firefox within some days To install as developer extension please follow the steps: https://github.com/arunelias/session-alive#installation