Greasy Fork is available in English.

[TS] Linx Amender

Generic tracking/redirection/open-in-new-tab removal; Amend page title; URL redirector; and more power functionality. Has rules for Pixiv, deviantArt, twitter, youtube, blogger, Batota etc.

< Feedback on [TS] Linx Amender

Question/comment

§
Posted: 2015.05.05.
Edited: 2015.05.05.

help with video embed rule

screwed up - see next post...

§
Posted: 2015.05.05.

no Flash plugin installed and i want to be able to play embedded video

i found that Firefox will play videos if they are embedded as an iframe, but if they use the embed tag instead, then the browser is asking to install Flash

so i need to convert HTML like this:

<embed src="http://www.youtube.com/v/P9sCshUboug?version=3&amp;hl=en_US" allowfullscreen="true" allowscriptaccess="always" type="application/x-shockwave-flash" height="342" width="608">

into this...

<iframe src="https://www.youtube.com/embed/P9sCshUboug?feature=oembed" allowfullscreen="" height="340" width="604"></iframe>

converting the URL is no problem, but how do i change the opening embed tag to an iframe tag? and add the closing </iframe> tag?

TimidScriptAuthor
§
Posted: 2015.05.05.

Hiya,

I really need to write the guide page. Been saying that for months :). What you need to do is edit the element key "outerHTML". You edit object keys by the prefix "=".

Assuming you already have the search-replace to change the src, the rest is something like below:

{"id":"L1430836041895","type":1,"name":"Video Example","nthNode":"0","selectors":"embed","regexes":[{"name":"convertURL","search":"YOUKNOW","replace":"YOUKNOW"},{"name":"=outerHTML","search":"","replace":""}],"enabled":true,"timestamp":1430836041895}


Just replace the convertURL rule first. Hope that makes sense.

(FYI: There is an edit post option under the cog menu on the right side.)

§
Posted: 2015.05.08.

strange - i checked this thread today and didn't see your reply - sorry :)

since "src" is not present in your example rule, i really have no idea what i'm doing now

what goes in the outerHTML search and replace?

TimidScriptAuthor
§
Posted: 2015.05.08.
Edited: 2015.05.08.

I didn't check what came out. It removed all the element tags when posted as it treated it as html. Using markdown should fix the issue.

{"id":"L1430836041895","type":1,"name":"Video Example","nthNode":"0","selectors":"embed","regexes":[{"name":"convertURL","search":"YOUKNOW","replace":"YOUKNOW"},{"name":"=outerHTML","search":"<embed.+src=\"([^\"]+)\".+>","replace":"<iframe src=\"$1\" height=\"340\" width=\"604\"></iframe>"}],"enabled":true,"timestamp":1430836041895}

Copy and paste the above into the Paste Rules dialog. Make changes accordingly. (convertURL rule is the part where you change the src)

Post reply

Sign in to post a reply.