Skip to content

Commit

Permalink
Support linking to content for non-iframe widgets
Browse files Browse the repository at this point in the history
  • Loading branch information
ghostwords committed Sep 29, 2021
1 parent 7e44c07 commit 7cdb69f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/js/contentscripts/socialwidgets.js
Original file line number Diff line number Diff line change
Expand Up @@ -472,8 +472,10 @@ function createReplacementWidget(widget, elToReplace, activationFn) {

// get a direct link to widget content when available
let widget_url;
// use the frame URL for framed widgets
if (elToReplace.nodeName.toLowerCase() == 'iframe' && elToReplace.src) {
if (widget.directLinkUrl) {
widget_url = widget.directLinkUrl;
} else if (elToReplace.nodeName.toLowerCase() == 'iframe' && elToReplace.src) {
// use the frame URL for framed widgets
widget_url = elToReplace.src;
}

Expand Down
3 changes: 2 additions & 1 deletion src/js/contentscripts/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ document.addEventListener("pbSurrogateMessage", function (e) {
replacementButton: {
"unblockDomains": ["rumble.com"],
"type": 4
}
},
directLinkUrl: `https://rumble.com/embed/${encodeURIComponent(data.pubCode)}.${encodeURIComponent(data.args[1].video)}/`
}
});

Expand Down

0 comments on commit 7cdb69f

Please sign in to comment.