Skip to content

Commit

Permalink
Check for incorrect username on reblogs
Browse files Browse the repository at this point in the history
  • Loading branch information
jcutler committed May 20, 2011
1 parent 2fa9805 commit 5845891
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
10 changes: 5 additions & 5 deletions chrome/background.html
Expand Up @@ -850,16 +850,16 @@
activeScripts.askFixes = false;
}
if (sender.tab.url == request.url &&
((request.bodyId == 'dashboard_edit_post' &&
(/http:\/\/www\.tumblr\.com\/new\//.test(sender.tab.url) ||
/http:\/\/www\.tumblr\.com\/tumblelog\/[0-9A-Za-z\-\_]+\/new\//.test(sender.tab.url) ||
/http:\/\/www\.tumblr\.com\/reblog\//.test(sender.tab.url) ||
/http:\/\/www\.tumblr\.com\/edit\/[0-9]+/.test(sender.tab.url))) ||
((/http:\/\/www\.tumblr\.com\/new\//.test(sender.tab.url) ||
/http:\/\/www\.tumblr\.com\/tumblelog\/[0-9A-Za-z\-\_]+\/new\//.test(sender.tab.url) ||
/http:\/\/www\.tumblr\.com\/reblog\//.test(sender.tab.url) ||
/http:\/\/www\.tumblr\.com\/edit\/[0-9]+/.test(sender.tab.url)) ||
(/http:\/\/www\.tumblr\.com\/messages/.test(sender.tab.url) ||
/http:\/\/www\.tumblr\.com\/tumblelog\/[A-Za-z0-9\-\_]+\/messages/.test(sender.tab.url) ||
/http:\/\/www\.tumblr\.com\/submissions/.test(sender.tab.url) ||
/http:\/\/www\.tumblr\.com\/tumblelog\/[A-Za-z0-9\-\_]+\/submissions/.test(sender.tab.url)) ||
(/http:\/\/www\.tumblr\.com\/share/.test(sender.tab.url)))) {

if (getStorage("MissingE_postingFixes_enabled",1) == 1) {
activeScripts.postingFixes = true;
chrome.tabs.executeScript(sender.tab.id, {file: "postingFixes/postingFixes.js"});
Expand Down
13 changes: 13 additions & 0 deletions chrome/betterReblogs/betterReblogs_fill.js
Expand Up @@ -43,8 +43,21 @@ function getReblogTags() {
}
}



chrome.extension.sendRequest({greeting: "settings", component: "betterReblogs"},
function(response) {
if (document.body.id !== 'dashboard_edit_post') {
if (/[\?&]channel_id=/.test(location.href) &&
/Request denied/i.test($('#container').text())) {
var blog = location.href.match(/[\?&]channel_id=([^&]*)/)[1];
$('<p>You attempted to reblog using Tumblr username:<br /><strong>' +
blog + '</strong></p><p>This may not be a valid username!<br />' +
'Please check your <em>Missing e</em> settings.</p>')
.insertBefore('#container div.sorry p:last');
}
return false;
}
var reblogTagsText = {
reblog: {
en: "Reblog Tags",
Expand Down

0 comments on commit 5845891

Please sign in to comment.