-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5bf5c1d
commit 1a0927d
Showing
2 changed files
with
28 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,35 @@ | ||
|
||
chrome.storage.session.get(['urlToBeArchived'], function(result) { | ||
console.log('Url to be archived is: ' + result.urlToBeArchived); | ||
|
||
var shadowRoot = document.querySelector('app-root').shadowRoot; | ||
console.log(shadowRoot); | ||
|
||
var routerSlotElement = shadowRoot.querySelector('router-slot'); | ||
console.log(routerSlotElement); | ||
const currentUrl = window.location.href; | ||
|
||
var homeShadow = routerSlotElement.querySelector('home-page').shadowRoot; | ||
console.log(homeShadow); | ||
if(currentUrl === "https://web.archive.org/") { | ||
var shadowRoot = document.querySelector('app-root').shadowRoot; | ||
console.log(shadowRoot); | ||
|
||
var containerShadow = homeShadow.querySelector('ia-wayback-search').shadowRoot; | ||
console.log('Container Shadow' + containerShadow); | ||
var routerSlotElement = shadowRoot.querySelector('router-slot'); | ||
console.log(routerSlotElement); | ||
|
||
var textBox = containerShadow.querySelector('#url'); | ||
textBox.value = result.urlToBeArchived; | ||
var homeShadow = routerSlotElement.querySelector('home-page').shadowRoot; | ||
console.log(homeShadow); | ||
|
||
var form = containerShadow.querySelector('form'); | ||
console.log(form); | ||
form.requestSubmit(); | ||
}); | ||
var containerShadow = homeShadow.querySelector('ia-wayback-search').shadowRoot; | ||
console.log('Container Shadow' + containerShadow); | ||
|
||
var textBox = containerShadow.querySelector('#url'); | ||
textBox.value = result.urlToBeArchived; | ||
|
||
var form = containerShadow.querySelector('form'); | ||
console.log(form); | ||
form.requestSubmit(); | ||
} | ||
|
||
if(currentUrl === "https://archive.ph/") { | ||
var form = document.querySelector('#submiturl'); | ||
var textBox = form.querySelector('#url'); | ||
|
||
textBox.value = result.urlToBeArchived; | ||
form.requestSubmit(); | ||
} | ||
}); |